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§
- DEFAULT_
PID_ FILE - Default path for the PID file written after successful daemonization.
Functions§
- daemonize
- Daemonize the current process.
- stop_
daemon - Stop a running pwr-server daemon.