[lxc-devel] startup scripts for lxc containers?

Michael Holzt lxc at my.fqdn.org
Sat Jan 16 16:22:04 UTC 2010


> > 2. As the first process in the container a daemon e.g. lxc-ctld is launched
> >    which becomes pid 1. It will fork so that it will become pid 2 also and
> >    then in pid 1 a exec to the init binary is done so that init will be pid 
> >    1 as it expects. This process keeps one end of the pipe.
> As I said in an earlier message, I like this idea.  Only downside is
> what if "lxc-ctld" is not present in the container? 

It does not need to be. What was missing from my post was that lxc-ctld
would need to takeover some of the actions currently done by lxc-start,
e.g. the pivot_root. So lxc_ctld would be loaded from the host root fs,
and then finish the initialisation like pivot_root, drop capabilities
etc. before continuing with the forking as described above.

> My general attitude is that you should modify the container system as little as 
> possible.

Right. But honestly all of our ideas are nothing more than hacks. The 
real solution would be to push the maintainers of sysvinit and replacements
to implement a parameter or something which makes it exit when no more
processes are left. The exit code should signal reboot or halt.

Regards,
Michael

-- 
It's an insane world, but i'm proud to be a part of it. -- Bill Hicks




More information about the lxc-devel mailing list