[systemd-devel] pid namespaces, systemd and signals on reboot(2)

Lennart Poettering lennart at poettering.net
Mon May 29 09:37:55 UTC 2017


On Sat, 27.05.17 20:51, MichaƂ Zegan (webczat_200 at poczta.onet.pl) wrote:

> Hello.
> 
> I came across the following:
> The manpage reboot(2) says, that inside of a pid namespace, a reboot
> call that normally would trigger restart actually triggers sending
> sighup to the init of a namespace, and sigint is sent in case of
> halt/poweroff.

That's misleading. This is not what happens. Instead, PID 1's parent
(i.e. the container manager) will be notified about reboot() being
called inside the container by a waitid() event of the container's PID
1, where the exit cause is reported to be an uncaught SIGHUP.

It's quite hacky to report it that way, since there's no way to
distuingish a real SIGHUP exit from a reboot() exit this way, but it's
how the the kernel decided to do it.

Or in other words: SIGHUP on the container's PID 1 is how the reboot()
is *reported*, not what actually happened.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list