[lxc-devel] detecting reboot/halt...

Michael Tokarev mjt at tls.msk.ru
Thu Apr 8 07:56:48 UTC 2010


I come across a series of patches to implement
reboot/halt of a container.  Patches were discussed
before, but I had no time to look at that stuff in
more detail...

The problem.  The current detection is based on the
content of container's /var/run/utmp.  This is goood
provided the container actually touches that file,
but this is not true for "single-application"
containers, i.e. the ones without full init.d
system.

There are only two reliable ways to get this to work:
it's either catching sys_reboot() (for which kernel
support/changes is needed), or replacing poweroff or
halt (or introducing a separate utility) which will
notify the parent process about the event in some
way (sending signal, connecting to a socket, writing
something to a pipe and the like).

I remember something of that sort were proposed
too, but I can't find the details now.  Are there
some patches or git branch with that stuff?

Thanks!

/mjt




More information about the lxc-devel mailing list