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

@ -124,7 +124,6 @@ async fn run() -> Result<(), Error> {
.await
})
},
"proxmox-backup.service",
);
proxmox_rest_server::write_pid(pbs_buildcfg::PROXMOX_BACKUP_API_PID_FN)?;

View File

@ -275,7 +275,6 @@ async fn run() -> Result<(), Error> {
.await
})
},
"proxmox-backup-proxy.service",
);
proxmox_rest_server::write_pid(pbs_buildcfg::PROXMOX_BACKUP_PROXY_PID_FN)?;