[Lxc-users] Debian Containers hangs when starting.

Glenn Daneels glenndaneels at gmail.com
Mon Jul 9 13:23:29 UTC 2012


I found out what was missing in my debian template script. My config file
asked for 6 tty's while probably only 2 got constructed (seems to be
default by Squeeze), so I added:

    # squeeze only has /dev/tty and /dev/tty0 by default,
    # therefore creating missing device nodes for tty1-4.
    for tty in $(seq 1 4); do
	if [ ! -e $rootfs/dev/tty$tty ]; then
	    mknod $rootfs/dev/tty$tty c 4 $tty
	fi
    done

    # configure the inittab
    cat <<EOF > $rootfs/etc/inittab
id:3:initdefault:
si::sysinit:/etc/init.d/rcS
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin
1:2345:respawn:/sbin/getty 38400 console
c1:12345:respawn:/sbin/getty 38400 tty1 linux
c2:12345:respawn:/sbin/getty 38400 tty2 linux
c3:12345:respawn:/sbin/getty 38400 tty3 linux
c4:12345:respawn:/sbin/getty 38400 tty4 linux
c5:12345:respawn:/sbin/getty 38400 tty5 linux
c6:12345:respawn:/sbin/getty 38400 tty6 linux
 EOF

That seemed to do the trick!

Thanks,

Glenn


On Mon, Jul 9, 2012 at 12:00 PM, Fajar A. Nugraha <list at fajar.net> wrote:

> On Mon, Jul 9, 2012 at 4:40 PM, Glenn Daneels <glenndaneels at gmail.com>
> wrote:
> > I already use lxc-create -t debian to fire up the linux container.
> > I don't know where to find that /usr/lib/lxc/templates/lxc-debian file,
> it
> > seems not to exist on my system... (Did I forget to install something?)
>
> That's the path on ubuntu. try "dpkg -L lxc", perhaps, to see where
> it's installed on your system?
>
> The source for lxc-0.8.0-rc2:
>
> http://lxc.git.sourceforge.net/git/gitweb.cgi?p=lxc/lxc;a=tree;f=templates;h=34b72f25bad0cc7c0f3faf0a96e15624e4899de8;hb=ed55bf5203aca88809d979b289d6b2280a18e79c
>
> Look at lxc-debian.in on that page, search "tty0". It should give you
> an idea what to try.
>
> --
> Fajar
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20120709/8db0daf1/attachment.html>


More information about the lxc-users mailing list