]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
centos: Fix booting a Centos 6 container
authorStéphane Graber <stgraber@ubuntu.com>
Thu, 29 Jan 2015 21:59:58 +0000 (22:59 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 29 Jan 2015 23:07:30 +0000 (00:07 +0100)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
templates/lxc-centos.in

index 4696ce37e78e0ce33fe0ad16e0c05269c51fba63..dd9b25424d7711fdd3d5a0e88e00a2573c5d398d 100644 (file)
@@ -270,7 +270,6 @@ EOF
     # set minimal fstab
     cat <<EOF > $rootfs_path/etc/fstab
 /dev/root               /                       rootfs   defaults        0 0
-none                    /dev/shm                tmpfs    nosuid,nodev    0 0
 EOF
 
     # create lxc compatibility init script
@@ -280,14 +279,19 @@ start on startup
 env container
 
 pre-start script
-        if [ "x$container" != "xlxc" -a "x$container" != "xlibvirt" ]; then
+        if [ "x\$container" != "xlxc" -a "x\$container" != "xlibvirt" ]; then
                 stop;
         fi
-        initctl start tty TTY=console
+
         rm -f /var/lock/subsys/*
         rm -f /var/run/*.pid
+        [ -e /etc/mtab ] || ln -s /proc/mounts /etc/mtab
+        mkdir -p /dev/shm
+        mount -t tmpfs -o nosuid,nodev tmpfs /dev/shm
+
+        initctl start tty TTY=console
         telinit 3
-        exit 0;
+        exit 0
 end script
 EOF
     elif [ "$release" = "5" ]; then