[lxc-devel] [PATCH] debian: Symlink /etc/mtab

Stéphane Graber stgraber at ubuntu.com
Fri Mar 21 14:34:00 UTC 2014


On Wed, Mar 19, 2014 at 07:06:13AM +0100, Holger Amann wrote:
> /etc/mtab doesn’t exist after bootstrapping a debian container, and will be created as regular file after first start.
> That leads to at least two errors:
> 
> - output of `mount` is wrong and get messed up the more often you start/stop the container
> - /dev/pts/ptmx has wrong permissions
> 
> Signed-off-by: Holger Amann <holger at sauspiel.de>

I'm surprised Debian doesn't do an initial /proc/mounts to /etc/mtab
copy at boot time, but apparently it doesn't (just tried with a Jessie
container), so I guess we'll need that workaround...

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
> templates/lxc-debian.in | 3 +++
> 1 file changed, 3 insertions(+)
> 
> diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in
> index 7ad8e3c..63a44a6 100644
> --- a/templates/lxc-debian.in
> +++ b/templates/lxc-debian.in
> @@ -144,6 +144,9 @@ EOF
>         echo "Timezone in container is not configured. Adjust it manually."
>     fi
> 
> +    # symlink mtab
> +    ln -s /proc/self/mounts $rootfs/etc/mtab
> +
>     echo "root:root" | chroot $rootfs chpasswd
>     echo "Root password is 'root', please change !"
> 
> --
> 1.8.4.1
> 
> 
> _______________________________________________
> 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/20140321/2720dfe5/attachment.pgp>


More information about the lxc-devel mailing list