Commit 42ff5f0f by Serge Hallyn Committed by Daniel Lezcano

lxc-ubuntu*: in precise, make /dev/shm a symbolic link to /run/shm

This would be done (though done wrongly) by mounted-dev.conf, but that doesn't run because we don't mount /dev. Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 5a0f7f3c
......@@ -31,6 +31,7 @@ copy_configuration()
rootfs=$2
name=$3
arch=$4
release=$5
if [ $arch = "i386" ]; then
arch="i686"
......@@ -91,6 +92,16 @@ proc proc proc nodev,noexec,nosuid 0 0
sysfs sys sysfs defaults 0 0
EOF
# rmdir /dev/shm in precise containers.
# I'm afraid of doing rm -rf $rootfs/dev/shm, in case it did
# get bind mounted to the host's /run/shm. So try to rmdir
# it, and in case that fails move it out of the way.
if [ $release = "precise" ]; then
[ -d "$rootfs/dev/shm" ] && rmdir $rootfs/dev/shm
[ -e "$rootfs/dev/shm" ] && mv $rootfs/dev/shm $rootfs/dev/shm.bak
ln -s /run/shm $rootfs/dev/shm
fi
return 0
}
......@@ -358,7 +369,7 @@ EOF
) 200>/var/lock/subsys/lxc-ubucloud
copy_configuration $path $rootfs $name $arch
copy_configuration $path $rootfs $name $arch $release
echo "Container $name created."
exit 0
......@@ -517,6 +517,16 @@ post_process()
chroot $rootfs apt-get update
chroot $rootfs apt-get install --force-yes -y --no-install-recommends upstart:${hostarch} mountall:amd64 iproute:amd64 isc-dhcp-client:amd64
fi
# rmdir /dev/shm in precise containers.
# I'm afraid of doing rm -rf $rootfs/dev/shm, in case it did
# get bind mounted to the host's /run/shm. So try to rmdir
# it, and in case that fails move it out of the way.
if [ $release = "precise" ]; then
[ -d "$rootfs/dev/shm" ] && rmdir $rootfs/dev/shm
[ -e "$rootfs/dev/shm" ] && mv $rootfs/dev/shm $rootfs/dev/shm.bak
ln -s /run/shm $rootfs/dev/shm
fi
}
do_bindhome()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment