rest: daemon: comment why using a systemd barrier is important for main PID handover

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-10-01 15:04:58 +02:00
parent 0a6df20986
commit 9a1330c72e
1 changed files with 2 additions and 0 deletions

View File

@ -186,6 +186,8 @@ impl Reloader {
if let Err(e) = systemd_notify(SystemdNotify::MainPid(child)) {
log::error!("failed to notify systemd about the new main pid: {}", e);
}
// ensure systemd got the message about the new main PID before continuing, else it
// will get confused if the new main process sends its READY signal before that
if let Err(e) = systemd_notify_barrier() {
log::error!("failed to wait on systemd-processing: {}", e);
}