[lxc-users] Ubuntu (maverick) container hangs at init

Stephen Zhang zsrkmyn at gmail.com
Thu May 15 08:51:10 UTC 2014


2014-05-15 16:16 GMT+08:00 Fajar A. Nugraha <list at fajar.net>:

> On Thu, May 15, 2014 at 2:56 PM, Stephen Zhang <zsrkmyn at gmail.com> wrote:
>
>> Hi all,
>>   I installed a ubuntu maverick (really an old release, but I have to use
>> it) using the following command:
>>            lxc-creat -t ubuntu -n ubuntu -f config -- -r maverick
>> the official repository is invalid now, so I changed it to
>> http://mirror.usu.ru/ubuntu/ in debootstap script and lxc-ubuntu
>> template.
>>
>
> you should be able to add "---mirror http://..." in the end without
> editing anything.
>
> init: lxcguest pre-start process (4) exited normally
>>
>
> I'd say you should investigate that
>
>
>> init: lxcguest state changed from pre-start to spawned
>> init: lxcguest state changed from spawned to post-start
>> init: lxcguest state changed from post-start to running
>> init: Handling started event
>>
>> And my lxcguest.conf in /etc/init/ is here (removing this file also
>> failed to start the container):
>>
>> description "track if this is lxc instance"
>>
>> start on startup
>>
>> env container
>> env LIBVIRT_LXC_UUID
>>
>> pre-start script
>>    [ -z $container ] && [ -z $LIBVIRT_LXC_UUID ] && stop
>>    # clean up /var/run - in case the container shutdown did not
>>    rm -rf /var/run/*
>>    touch /var/run/utmp
>>    chown root:utmp /var/run/utmp
>>    exit 0
>> end script
>>
>>
>
> Try also including /var/lock/*/* in there. Perhaps a subsystem refused to
> start since it sees a stale lockfile.
>
>
> none /lxc/rootfs.ubuntu/dev/pts devpts defaults 0 0
>>
>
> I'm pretty sure you don't need that
>
>
>>  sysfs sys sysfs ro,defaults 0 0
>> proc proc proc nodev,noexec,nosuid 0 0
>> /proc/sys /home/stephen/lxc/ubuntu/rootfs/proc/sys none ro,bind 0 0
>> /etc/resolv.conf /home/stephen/lxc/ubuntu/rootfs/etc/resolv.conf none
>> ro,bind 0 0
>>
>> So, what's wrong with my container?
>>
>> [1]
>> http://blog.bodhizazen.net/linux/lxc-configure-ubuntu-lucid-containers/
>>
>>
> Can you try http://wiki.1tux.org/wiki/Lxc/Installation/Guest/Centos/6,
> look for "fstab" (both the config and rootfs part)? My hunch is that your
> /dev/pts line made it worse.
>
> --
> Fajar
>
>

Thanks for replaying me.
I also tried some times in different configuration, here are details:
I corrected the line in fstab "none /lxc/rootfs.ubuntu/dev/pts devpts
defaults 0 0" to right path, failed.
I comment the line above, failed.
I change the whole fstab using
http://wiki.1tux.org/wiki/Lxc/Installation/Guest/Centos/6 provides, failed.
TAT
All the things happened as the same.
I also changed the lxcguest.conf (the original one is provided by the
package lxcguest) to this (which is found in a previous mail list):

start on startup

env container
env LIBVIRT_LXC_UUID

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

Failed as well, but the /sbin/init shows different result:

init: Handling startup event
init: lxcguest goal changed from stop to start
init: lxcguest state changed from waiting to starting
init: hostname goal changed from stop to start
init: hostname state changed from waiting to starting
init: Handling starting event
init: lxcguest state changed from starting to pre-start
init: lxcguest state changed from pre-start to spawned
init: lxcguest main process (4)
init: lxcguest state changed from spawned to post-start
init: lxcguest state changed from post-start to running
init: Handling starting event
init: hostname state changed from starting to pre-start
init: hostname state changed from pre-start to spawned
init: hostname main process (5)
init: hostname state changed from spawned to post-start
init: hostname state changed from post-start to running
init: Handling started event
init: Handling started event
init: hostname main process (5) exited normally
init: hostname goal changed from start to stop
init: hostname state changed from running to stopping
init: Handling stopping event
init: hostname state changed from stopping to killed
init: hostname state changed from killed to post-stop
init: hostname state changed from post-stop to waiting
init: Handling stopped event
init: Connection from private client
init: Handling stopped event
init: Connection from private client
init: Handling started event
init: lxcguest main process (4) exited normally
init: lxcguest goal changed from start to stop
init: lxcguest state changed from running to stopping
init: Handling stopping event
init: lxcguest state changed from stopping to killed
init: lxcguest state changed from killed to post-stop
init: lxcguest state changed from post-stop to waiting
init: Handling stopped event

Regards,
Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140515/80260d5e/attachment.html>


More information about the lxc-users mailing list