mirror of
https://codeberg.org/icewind/netnsd.git
synced 2026-06-03 09:04:07 +02:00
custom service status
This commit is contained in:
parent
7fca98398b
commit
1d00c3973d
1 changed files with 16 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue