[lxc-users] old Ubuntu 8.04 container, /sbin/init fails

jf jfmeteo at gmail.com
Sat Jan 21 20:53:39 UTC 2017


Thanks for the help.
So what I miss is how to debug /sbin/init in a container ?
I saw that lxc-start has an extra argument to execute the init command like
lxc-start -n container /sbin/init.
But I'm using lxd and didn't find any equivalent command for lxc start.

2017-01-21 21:36 GMT+01:00 Fajar A. Nugraha <list at fajar.net>:

> On Sun, Jan 22, 2017 at 3:08 AM, jf <jfmeteo at gmail.com> wrote:
>
>> Hi,
>>
>> I'm using Ubuntu 16.04 with the default Ubuntu lxd package.
>> I'm trying to start a  Ubuntu 8.04 container, but I didn't find any
>> image. So I built and imported an image from deboostrap.
>>
>>
> Whenever possibly, don't try to run any end-of-life distro, as it could
> open yourself to various security hole, and possibly harm others (e.g. when
> your setup is compromized by botnet). Even if it's in container.
>
>
>
>> When I start the container, /sbin/init doesn't init anything and "lxc
>> stop" hangs:
>>   * lxc start ub8
>>   * lxc exec ub8 ps auwwx
>> USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
>> root         1  0.0  0.0   4020  1428 ?        Ss   Jan22   0:00
>> /sbin/init
>> root        25  0.0  0.0  14856  1700 ?        Rs+  Jan22   0:00 ps auwwx
>>
>>
>> If I run these 3 commands:
>>   * lxc start ub8
>>   * lxc exec ub8 /etc/init.d/rc S
>>   * lxc exec ub8 /etc/init.d/rc 2
>> everything goes fine: the system is initialized and I can stop it.
>>
>> Do I miss something ? Why do I need to manually run /etc/init.d/rc ?
>>
>>
> Short version: some changes are necessary to run inside a container. Newer
> distro versions (e.g. xenial) has those changes built in, older ones don't.
>
> See https://github.com/lxc/lxc/blob/master/templates/lxc-centos.in on
> what some of the changes look like for a sysvinit-based distro (this
> includes editing /etc/inittab).
>
> --
> Fajar
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170121/b1933bbc/attachment.html>


More information about the lxc-users mailing list