Skip to main content

Module registry

Module registry 

Source
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§

DaemonInfo
daemon.json — pid + profile + paths only. Never credentials.
DaemonLock
Held for the daemon’s lifetime; dropping releases the flock.
SpawnLock
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/pid if — and only if — no daemon holds the lock. Returns true when something stale was removed.
write_daemon_json
Write daemon.json + daemon.pid atomically (tmp + rename), 0600.
write_private_atomic
0600 tmp + rename (reload-state).