Expand description
daemon.json / daemon.lock / daemon.pid under registry_dir()
(PLAN-phase2 §2.11). The flock on daemon.lock is THE liveness oracle
(jcode socket.rs:89-139): a daemon is alive iff someone holds the lock.
A socket file with no lock holder is stale and gets unlinked. Nobody
unlinks on ECONNREFUSED alone.
Re-exports§
pub use crate::events::registry::daemon_paths;pub use crate::events::registry::daemon_paths_in;pub use crate::events::registry::DaemonPaths;
Structs§
- Daemon
Info daemon.json— pid + profile + paths only. Never credentials.- Daemon
Lock - Held for the daemon’s lifetime; dropping releases the flock.
- Spawn
Lock - Held while a client spawns the daemon; dropping releases it.
Functions§
- is_
alive - Liveness probe: try to take the lock; success means nobody holds it (dead or never started) — release immediately. Never unlinks anything.
- read_
daemon_ json - reap_
stale - Unlink
sock/json/pidif — and only if — no daemon holds the lock. Returnstruewhen something stale was removed. - write_
daemon_ json - Write
daemon.json+daemon.pidatomically (tmp + rename), 0600. - write_
private_ atomic - 0600 tmp + rename (reload-state).