[systemd-devel] I am adding RegisterMachine to docker.
lennart at poettering.net
Fri May 29 07:37:02 PDT 2015
On Thu, 28.05.15 16:05, Daniel J Walsh (dwalsh at redhat.com) wrote:
> When container stops machinectl still shows it registered? Do I need to
> Unregister the machine? I though systemd would notice the pid died and
> remove the machine.
Most likely it's not machined/machinectl that is confused here, but
actually systemd itself.
Do you still see the contaienr's scope in "systemctl"'s output when
Unfortunately it's really nasty to properly shut down a scope in a
robust way, since the cgroups empty notification is unreliable: it
will not be generated if there's a subcrgoup still in a cgroup. Which
means a container that creates subcgroups and then dies will never be
noticed as dead.
This will become robust as soon as we rework things for the unified
hierarchy, since that for the first time supports reliable
notifications and even inside of containers.
In order to make this as robust as possible on current systems, please
not only register your machines with machined from your container
manager, but also unregister them explicitly, by invoking the
"Terminate()" method on the machine object. This has the effect of
asking systemd to recheck the scope, and then has the benefit of
making it notice that the scope is dying...
Lennart Poettering, Red Hat
More information about the systemd-devel