[Lxc-users] Ubuntu (maverick) container won't start (hangs at init)

Thomas Schweikle tps at vr-web.de
Wed Dec 29 11:42:16 UTC 2010


Am 29.12.2010 12:12, schrieb Wilhelm:
> Am 29.12.2010 11:44, schrieb Thomas Schweikle:
>> Hi!
>> 
>> After setting up an ubuntu container (maverick, 10.10). I tried to
>> start it --- but: it just hangs at init after doing
>> 
>> lxc-start -n cnt
>> 
>> I followed the instructions given at:
>> 
>> http://lxc.teegra.net/
>> https://help.ubuntu.com/community/LXC
>> http://blog.bodhizazen.net/linux/lxc-configure-ubuntu-lucid-containers/
>> https://www.ibm.com/developerworks/linux/library/l-lxc-containers/
>> 
>> but without any success. The container still hangs at init when started.
>> 
>> I've upgraded to lxc-tools 0.7.3: same problem. I've recreated the
>> container from scratch using
>> 
>> lxc-ubuntu -p /lxc
>> debootstrap --variant=minbase --arch x86_64 maverick rootfs.ubuntu
>> 
>> removed all scripts within /etc/init in the container, modified
>> rc.sysinit as given, removed all unnecessary devices, added all
>> necessary ones, created the config file, then created the container,
>> started it and --- frustratingly it hangs running init.
>> 
>> Any idea where to look next??
> 
> Look at the lxc-ubuntu template included in lxc.
> 
> The usual problem is that some upstart events are missing, mostly from
> mountall. These must be faked.

I've created the container using /usr/lib/lxc/templates/lxc-ubuntu,
as stated before. /etc/init/lxc.conf is created, holding
--- snip ----
# fake some events needed for correct startup other services

description     "Container Upstart"

start on startup

script
        rm -rf /var/run/*.pid
        rm -rf /var/run/network/*
        /sbin/initctl emit stopped JOB=udevtrigger --no-wait
        /sbin/initctl emit started JOB=udev --no-wait
end script
--- snap ----

only one other script is in /etc/init of the container "hostname.conf":
--- snip ----
# hostname - set system hostname
#
# This task is run on startup to set the system
# hostname from /etc/hostname,
# falling back to "localhost" if that file is not
# readable or is empty and
# no hostname has yet been set.

description     "set system hostname"

start on startup

task
exec hostname -b -F /etc/hostname
--- snap ----

Starting the container with "lxc-start -n con" just hangs. Looking
at the host from an other shell (or using "screen -dmS con lxc-start
-n con"):
--- snip ----
12232 ?        Ss     0:00 SCREEN -dmS tps lxc-start -n tps
12234 pts/3    Ss+    0:00  \_ lxc-start -n tps
12235 ?        Ss     0:00      \_ /sbin/init
--- snap ----

That's it. Hangs running init! At least I would expect to have
something like seen after starting linux on real hardware.

-- 
Thomas





More information about the lxc-users mailing list