Skip to main content

Module daemon

Module daemon 

Source

Functions§

cleanup_daemon_files
Cleanup PID file and IPC endpoint on shutdown.
daemon_addr
daemon_pid_path
daemon_status
init_foreground_daemon
Initialize the foreground-daemon process. Commits the XDG layout pin (and drains a residual ~/.lean-ctx) before the daemon writes anything, so this long-running, possibly launchd/systemd-autostarted writer can never re-collapse config/data/state/cache onto a stray legacy dir (GL #623). The MCP server pins on its own start; the daemon is the other independent entry point (e.g. serve --_foreground-daemon), so it must heal too. heal() is idempotent and cheap — a no-op once pinned and when no residual dir exists.
is_daemon_running
read_daemon_pid
start_daemon
stop_daemon