From dbe92cfb77856372b5698665e22a39757692d7fd Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Graber?= Date: Thu, 29 Jan 2015 22:37:47 +0100 Subject: [PATCH] centos: Fix booting a Centos 6 container MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- templates/lxc-centos.in | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/templates/lxc-centos.in b/templates/lxc-centos.in index 3edc80ac1..128dc167c 100644 --- a/templates/lxc-centos.in +++ b/templates/lxc-centos.in @@ -264,7 +264,6 @@ EOF # set minimal fstab cat < $rootfs_path/etc/fstab /dev/root / rootfs defaults 0 0 -none /dev/shm tmpfs nosuid,nodev 0 0 EOF # create lxc compatibility init script @@ -274,14 +273,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 -- 2.47.3