rest-server/daemon: use sd_notify_barrier for service reloading

until now, we manually polled the systemd service state during a reload
so that the sd_notify messages get processed in the correct order
(RELOAD(old) -> MAINPID(old) -> READY(new))

with systemd >= 246 there is now 'sd_notify_barrier' which
blocks until systemd processed all prior messages

with that change, the daemon does not need to know the service name anymore

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dominik Csapak
2021-09-30 09:18:58 +02:00
committed by Thomas Lamprecht
parent 6680878b5c
commit 0a6df20986
5 changed files with 22 additions and 44 deletions

View File

@ -213,7 +213,6 @@ async fn run() -> Result<(), Error> {
Ok(())
})
},
"example_server",
).await?;
Ok(())