custom service status

This commit is contained in:
Robin Appelman 2026-05-01 15:22:31 +02:00
commit 1d00c3973d

View file

@ -30,7 +30,14 @@ async fn daemon_async(mut config: Config) -> Result<(), DaemonError> {
state.update(&config)?;
// now the namespaces are setup, we can tell systemd to start any service depending on them
notify(&[NotifyState::Ready]).map_err(DaemonError::Notify)?;
notify(&[
NotifyState::Ready,
NotifyState::Status(&format!(
"Started with {} namespaces",
state.namespaces.len()
)),
])
.map_err(DaemonError::Notify)?;
let reload_signal = signal(SignalKind::hangup()).map_err(DaemonError::Signal)?;
let reload_signal = SignalStream::new(reload_signal).map(|_| Event::Reload);
@ -75,7 +82,14 @@ async fn daemon_async(mut config: Config) -> Result<(), DaemonError> {
}
}
notify(&[NotifyState::Ready]).map_err(DaemonError::Notify)?;
notify(&[
NotifyState::Ready,
NotifyState::Status(&format!(
"Reloaded with {} namespaces",
state.namespaces.len()
)),
])
.map_err(DaemonError::Notify)?;
}
Event::Info => {
for namespace in &state.namespaces {