[lxc-devel] [PATCH] ubuntu: Actually attempt to remove /dev/shm

Serge Hallyn serge.hallyn at ubuntu.com
Mon Dec 2 17:36:48 UTC 2013


Quoting Stéphane Graber (stgraber at ubuntu.com):
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  templates/lxc-ubuntu-cloud.in | 3 ++-
>  templates/lxc-ubuntu.in       | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/templates/lxc-ubuntu-cloud.in b/templates/lxc-ubuntu-cloud.in
> index 3042d89..e97c7e3 100644
> --- a/templates/lxc-ubuntu-cloud.in
> +++ b/templates/lxc-ubuntu-cloud.in
> @@ -139,8 +139,9 @@ EOF
>      # 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.
> +    # 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
> -        mv $rootfs/dev/shm $rootfs/dev/shm.bak
> +        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 4e6a54f..8ed9be7 100644
> --- a/templates/lxc-ubuntu.in
> +++ b/templates/lxc-ubuntu.in
> @@ -541,8 +541,9 @@ EOF
>      # 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.
> +    # 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
> -        mv $rootfs/dev/shm $rootfs/dev/shm.bak
> +        rmdir $rootfs/dev/shm 2>/dev/null || mv $rootfs/dev/shm $rootfs/dev/shm.bak
>          ln -s /run/shm $rootfs/dev/shm
>      fi
>  
> -- 
> 1.8.4.4
> 
> 
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT 
> organizations don't have a clear picture of how application performance 
> affects their revenue. With AppDynamics, you get 100% visibility into your 
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel




More information about the lxc-devel mailing list