Expand description
Unix daemonization for pwr-server.
Implements the classic double-fork daemonization pattern:
- Fork → parent exits, child continues
- setsid() to become session leader
- Second fork → child exits, grandchild continues (prevents re-acquisition of a controlling terminal)
- chdir(“/”), umask(0), redirect stdio to /dev/null
- Write PID file
Constants§
- SYSTEM_
PID_ FILE - Default path for the PID file written after successful daemonization (system-wide install).
Functions§
- daemonize
- Daemonize the current process.
- pid_
file_ for_ config - Given a config file path, return the appropriate PID file.
- stop_
daemon - Stop a running pwr-server daemon.
- user_
pid_ file - Return the PID file path for a user-level install.