[lxc-devel] autostart

Jäkel, Guido G.Jaekel at dnb.de
Tue Feb 19 08:58:50 UTC 2013


>Oh, forgot to add:
> - Get some kind of upstream support for container autostart.
>   The actual autostart would still be done by distro's init scripts,
>but the way it's set should be standardized.

Dear Stéphane,

like a corresponding BIOS feature of most real hardware, "autostart" maybe should behave as a three-state switch like "on lost of AC power": stay off, restore last state, always on. Obviously, this also needs to save the current state.

But "restore last state" might be the only feature of real worth: If a container is successfully started by lxc, some state marker ("running") is set (in the config file? In the containers root file system?). If it is gracefully halted, this marker is deleted (or the state is set to "stopped"). If it or the host is crashed, it's state will be restored afterwards on recovery.

The hosts lxc startup scripts may get a list of well-known containers and also may get this state maker (via some API) anf then may start the containers which should run. In the other hand, the hosts lxc shutdown script has to halt all running containers. But here, the current container state have to restored after stop to preserve the "autostart condition" for the next lxc start.






More information about the lxc-devel mailing list