Dominik Csapak d7c6ad60dd daemon: add hack for sd_notify
sd_notify is not synchronous, iow. it only waits until the message
reaches the queue not until it is processed by systemd

when the process that sent such a message exits before systemd could
process it, it cannot be associated to the correct pid

so in case of reloading, we send a message with 'MAINPID=<newpid>'
to signal that it will change. if now the old process exits before
systemd knows this, it will not accept the 'READY=1' message from the
child, since it rejects the MAINPID change

since there is no (AFAICS) library interface to check the unit status,
we use 'systemctl is-active <SERVICE_NAME>' to check the state until
it is not 'reloading' anymore.

on newer systemd versions, there is 'sd_notify_barrier' which would
allow us to wait for systemd to have all messages from the current
pid to be processed before acknowledging to the child, but on buster
the systemd version is to old...

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-11-11 09:43:00 +01:00
..
2020-08-25 18:52:31 +02:00
2020-10-14 13:58:35 +02:00
2020-07-10 11:08:53 +02:00
2020-11-11 09:43:00 +01:00
2020-08-25 18:52:31 +02:00
2020-10-14 13:58:35 +02:00
2020-10-08 08:34:39 +02:00
2020-06-26 09:12:29 +02:00
2020-10-28 21:26:11 +01:00
2020-10-21 11:31:24 +02:00
2020-06-23 06:33:31 +02:00
2020-10-21 14:20:16 +02:00