Skip to main content

write_self_daemon_pid

Function write_self_daemon_pid 

Source
pub fn write_self_daemon_pid() -> Result<()>
Expand description

Daemon-startup: claim the daemon.pid file for THIS process.

A daemon started directly (wire daemon, not via ensure_background) must write its own versioned-JSON pidfile so wire status / doctor / the singleton guard can see it. Idempotent: if the pidfile already records our PID we leave it untouched. (Historically this lived in pending_pair::cleanup_on_startup alongside the now-removed SAS pending-pair recovery; the pidfile write was never SAS-specific.)