mirror of
git://github.com/lxc/lxc
synced 2025-08-31 12:09:35 +00:00
Fix lxc-ubuntu and lxc-ubuntu-cloud to properly deal with /dev/shm.
Now that initscripts in Debian and Ubuntu has been updated to no longer do silly things with /dev/shm and /run/shm on installation/update, the check needs updating to detect any remaining broken case and fix it. Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
@@ -92,13 +92,12 @@ proc proc proc nodev,noexec,nosuid 0 0
|
||||
sysfs sys sysfs defaults 0 0
|
||||
EOF
|
||||
|
||||
# rmdir /dev/shm in precise and quantal containers.
|
||||
# rmdir /dev/shm for containers that have /run/shm
|
||||
# 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" ] || [ $release = "quantal" ]; then
|
||||
[ -d "$rootfs/dev/shm" ] && rmdir $rootfs/dev/shm
|
||||
[ -e "$rootfs/dev/shm" ] && mv $rootfs/dev/shm $rootfs/dev/shm.bak
|
||||
if [ ! -L $rootfs/dev/shm ] && [ -d $rootfs/run/shm ] && [ -e $rootfs/dev/shm ]; then
|
||||
mv $rootfs/dev/shm $rootfs/dev/shm.bak
|
||||
ln -s /run/shm $rootfs/dev/shm
|
||||
fi
|
||||
|
||||
|
@@ -511,9 +511,8 @@ post_process()
|
||||
# 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 [ -d $rootfs/run/shm ]; then
|
||||
[ -d "$rootfs/dev/shm" ] && rmdir $rootfs/dev/shm
|
||||
[ -e "$rootfs/dev/shm" ] && mv $rootfs/dev/shm $rootfs/dev/shm.bak
|
||||
if [ ! -L $rootfs/dev/shm ] && [ -d $rootfs/run/shm ] && [ -e $rootfs/dev/shm ]; then
|
||||
mv $rootfs/dev/shm $rootfs/dev/shm.bak
|
||||
ln -s /run/shm $rootfs/dev/shm
|
||||
fi
|
||||
}
|
||||
|
Reference in New Issue
Block a user