[Lxc-users] new containers doesn't start well after fresh creation.

Fajar A. Nugraha list at fajar.net
Wed Jul 4 00:22:54 UTC 2012


On Tue, Jul 3, 2012 at 7:13 PM, Stefan Schlesinger <sts at ono.at> wrote:
> Hello,
>
> yesterday we did some testing of LXC on wheezy as well and got the
> same results.
> Seems like the necessary device nodes aren't created (/dev/tty*)
> and /etc/inittab needs to be modified.
>
> Example:
>
>         c1:2345:respawn:/sbin/getty 38400 tty1 linux

I wonder how that can happen. For example, both Ubuntu's lxc-debian
and lxc's git source has this already, so the problem you're
experiencing shouldn't happen if the template is up to date

#=====================
configure_debian()
{
    rootfs=$1
    hostname=$2

    # 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
EOF
#=========================

-- 
Fajar




More information about the lxc-users mailing list