Work around systemd race condition (#3262)

Systemd reload can't handle us reloading so quickly which
causes "reload or restart" to always "restart" kanidm incorrectly.
This commit is contained in:
Firstyear 2024-12-03 13:09:05 +10:00 committed by William Brown
parent 7c82c951f5
commit 2ee5f0ccc4

View file

@ -787,8 +787,14 @@ async fn kanidm_main(
sctx.tls_acceptor_reload().await;
// Systemd freaks out if you send the ready state too fast after the
// reload state and can kill Kanidmd as a result.
tokio::time::sleep(std::time::Duration::from_secs(5)).await;
#[cfg(target_os = "linux")]
let _ = sd_notify::notify(true, &[sd_notify::NotifyState::Ready]);
info!("Reload complete");
}
Some(()) = async move {
let sigterm = tokio::signal::unix::SignalKind::user_defined1();