[lxc-devel] [PATCH] ubuntu templates: don't check for $rootfs/run/shm
Stéphane Graber
stgraber at ubuntu.com
Fri Aug 8 15:39:28 UTC 2014
On Thu, Aug 07, 2014 at 03:23:48AM +0000, Serge Hallyn wrote:
> /dev/shm must be turned from a directory into a symlink to /run/shm.
> The templates do this only if they find -d $rootfs/run/shm. Since /run
> will be a tmpfs, checking for it in the rootfs is silly. It also is
> currently broken as ubuntu cloud images have an empty /run.
>
> (this should fix https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1353734)
>
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>
> ---
> templates/lxc-ubuntu-cloud.in | 2 +-
> templates/lxc-ubuntu.in | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/templates/lxc-ubuntu-cloud.in b/templates/lxc-ubuntu-cloud.in
> index 5de1dbd..c4eb5ca 100644
> --- a/templates/lxc-ubuntu-cloud.in
> +++ b/templates/lxc-ubuntu-cloud.in
> @@ -122,7 +122,7 @@ EOF
> # 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.
> # NOTE: This can only be removed once 12.04 goes out of support
> - if [ ! -L $rootfs/dev/shm ] && [ -d $rootfs/run/shm ] && [ -e $rootfs/dev/shm ]; then
> + if [ ! -L $rootfs/dev/shm ] && [ -e $rootfs/dev/shm ]; then
> rmdir $rootfs/dev/shm 2>/dev/null || mv $rootfs/dev/shm $rootfs/dev/shm.bak
> ln -s /run/shm $rootfs/dev/shm
> fi
> diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in
> index e54b558..43d4817 100644
> --- a/templates/lxc-ubuntu.in
> +++ b/templates/lxc-ubuntu.in
> @@ -620,7 +620,7 @@ EOF
> # 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.
> # NOTE: This can only be removed once 12.04 goes out of support
> - if [ ! -L $rootfs/dev/shm ] && [ -d $rootfs/run/shm ] && [ -e $rootfs/dev/shm ]; then
> + if [ ! -L $rootfs/dev/shm ] && [ -e $rootfs/dev/shm ]; then
> rmdir $rootfs/dev/shm 2>/dev/null || mv $rootfs/dev/shm $rootfs/dev/shm.bak
> ln -s /run/shm $rootfs/dev/shm
> fi
> --
> 2.1.0.rc1
>
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140808/efd1c8f8/attachment.sig>
More information about the lxc-devel
mailing list