MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / notify_status

Function notify_status

nodedb-cluster/src/readiness.rs:45–58  ·  view source on GitHub ↗

Update the status string shown by `systemctl status`. Corresponds to systemd's `STATUS= `. Safe to call from any phase — passing a short human-readable string such as `"bootstrapping cluster"`, `"joining via 10.0.0.1:9400"`, or `"ready (3 nodes)"` makes cluster startup visibly progress even while `READY=1` has not yet been sent.

(msg: &str)

Source from the content-addressed store, hash-verified

43/// `"ready (3 nodes)"` makes cluster startup visibly progress even
44/// while `READY=1` has not yet been sent.
45pub fn notify_status(msg: &str) {
46 #[cfg(target_os = "linux")]
47 {
48 match sd_notify::notify(false, &[sd_notify::NotifyState::Status(msg)]) {
49 Ok(()) => debug!(status = msg, "sd_notify STATUS sent"),
50 Err(e) => warn!(error = %e, status = msg, "sd_notify STATUS failed"),
51 }
52 }
53 #[cfg(not(target_os = "linux"))]
54 {
55 let _ = msg;
56 debug!("sd_notify not supported on this platform; notify_status is a no-op");
57 }
58}
59
60/// Signal that the server is shutting down.
61///

Callers 2

transitionMethod · 0.85

Calls 1

StatusEnum · 0.50

Tested by 1