Function daemonize_rs::daemonize

source ·
pub fn daemonize<T: Into<PathBuf>>(pid_file: T) -> Result<Handle, Error>
Expand description

this will fork the calling process twice and return a handle to the grandchild process aka daemon, use the handle to detach from the parent process

before Handle::detach is called the daemon process has it’s STDOUT/STDERR piped to the parent process’ STDOUT/STDERR, this way any errors encountered by the daemon during start up is reported.