Expand description
Standalone process lifecycle functions for the SSH agent daemon.
Each function handles a single concern (PID files, signal checks, process spawning, termination) and is independently testable without a running Unix socket.
Functionsยง
- cleanup_
stale_ files - Remove stale daemon files (PID file, socket, environment file).
- is_
process_ running - Check whether a process with the given PID is running.
- read_
pid_ file - Read a process ID from a PID file, returning
Noneif the file does not exist. - socket_
is_ connectable - Test whether a Unix domain socket at
pathaccepts connections. - spawn_
detached - Spawn a detached daemon process by re-executing the current binary.
- terminate_
process - Send SIGTERM to a process and wait for it to exit, escalating to SIGKILL
if it does not terminate within
timeout. - write_
pid_ file - Write a process ID to a PID file with restricted permissions.