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

Fajar A. Nugraha list at fajar.net
Sat Jan 21 20:36:02 UTC 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170122/57c5ba9a/attachment.html>


More information about the lxc-users mailing list