mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-14 17:12:14 +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:
parent
b4df0a1eda
commit
542939c31b
@ -92,13 +92,12 @@ proc proc proc nodev,noexec,nosuid 0 0
|
|||||||
sysfs sys sysfs defaults 0 0
|
sysfs sys sysfs defaults 0 0
|
||||||
EOF
|
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
|
# 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
|
# 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.
|
# it, and in case that fails move it out of the way.
|
||||||
if [ $release = "precise" ] || [ $release = "quantal" ]; then
|
if [ ! -L $rootfs/dev/shm ] && [ -d $rootfs/run/shm ] && [ -e $rootfs/dev/shm ]; then
|
||||||
[ -d "$rootfs/dev/shm" ] && rmdir $rootfs/dev/shm
|
mv $rootfs/dev/shm $rootfs/dev/shm.bak
|
||||||
[ -e "$rootfs/dev/shm" ] && mv $rootfs/dev/shm $rootfs/dev/shm.bak
|
|
||||||
ln -s /run/shm $rootfs/dev/shm
|
ln -s /run/shm $rootfs/dev/shm
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -511,9 +511,8 @@ post_process()
|
|||||||
# I'm afraid of doing rm -rf $rootfs/dev/shm, in case it did
|
# 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
|
# 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.
|
# it, and in case that fails move it out of the way.
|
||||||
if [ -d $rootfs/run/shm ]; then
|
if [ ! -L $rootfs/dev/shm ] && [ -d $rootfs/run/shm ] && [ -e $rootfs/dev/shm ]; then
|
||||||
[ -d "$rootfs/dev/shm" ] && rmdir $rootfs/dev/shm
|
mv $rootfs/dev/shm $rootfs/dev/shm.bak
|
||||||
[ -e "$rootfs/dev/shm" ] && mv $rootfs/dev/shm $rootfs/dev/shm.bak
|
|
||||||
ln -s /run/shm $rootfs/dev/shm
|
ln -s /run/shm $rootfs/dev/shm
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user