]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
debian: Symlink /etc/mtab
authorHolger Amann <holger@sauspiel.de>
Wed, 19 Mar 2014 06:06:13 +0000 (07:06 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 21 Mar 2014 14:36:34 +0000 (10:36 -0400)
/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@sauspiel.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-debian.in

index aadfe25f5683c28ac8fb86f258a140ff8e17c90d..1c0123e1350b0efb333c1ef52b24e86084117935 100644 (file)
@@ -72,6 +72,10 @@ p6::ctrlaltdel:/sbin/init 6
 p0::powerfail:/sbin/init 0
 EOF
 
+    # symlink mtab
+    [ -e "$rootfs/etc/mtab" ] && rm $rootfs/etc/mtab
+    ln -s /proc/self/mounts $rootfs/etc/mtab
+
     # disable selinux in debian
     mkdir -p $rootfs/selinux
     echo 0 > $rootfs/selinux/enforce