Skip to main content

Module daemon

Module daemon 

Source
Expand description

Gateway daemon management — PID file, spawn, stop, status.

The gateway start command spawns the rustyclaw-gateway binary as a detached background process, writes a PID file to <settings_dir>/gateway.pid, and stores the log path alongside it.

gateway stop reads that PID file and terminates the process. gateway restart does stop-then-start. gateway status checks if the recorded PID is still alive.

All process management uses sysinfo and which for cross-platform support (macOS, Linux, Windows) with no cfg(unix) gates.

Enums§

DaemonStatus
Status of the gateway daemon.
StopResult

Functions§

is_process_alive
Check whether a process with the given PID is alive.
log_path
Returns the path to the gateway log file: <settings_dir>/logs/gateway.log.
pid_path
Returns the path to the PID file: <settings_dir>/gateway.pid.
read_pid
Read the stored PID, if the file exists and is valid.
remove_pid
Remove the PID file.
start
Spawn the rustyclaw-gateway binary as a background process.
status
Check the current daemon status.
stop
Stop a running gateway by terminating the process.
write_pid
Write a PID to the PID file.