Skip to content

Commit

Permalink
Merge pull request #116 from b3nj5m1n/sd_notify
Browse files Browse the repository at this point in the history
Send status update to systemd when daemon has initialized
  • Loading branch information
LGFae authored Apr 19, 2023
2 parents 8e18928 + e0ada26 commit 96061f7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions daemon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ simplelog = "0.12"
keyframe = "1.1"

utils = { path = "../utils" }
sd-notify = { version = "0.4.1" }

[dev-dependencies]
rand = "0.8"
5 changes: 5 additions & 0 deletions daemon/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,11 @@ fn main_loop(
}

info!("Initialization succeeded! Starting main loop...");
if let Ok(true) = sd_notify::booted() {
if let Err(e) = sd_notify::notify(true, &[sd_notify::NotifyState::Ready]) {
error!("Error sending status update to systemd: {}", e.to_string());
}
}
let mut loop_signal = event_loop.get_signal();
if let Err(e) = event_loop.run(None, &mut loop_signal, |_| {
{
Expand Down

0 comments on commit 96061f7

Please sign in to comment.