Crate parity_daemonize

source ·
Expand description

in rust calling fork closes all open file descriptors so to daemonize your program you have to call fork before you open any file descriptors but you might want to confirm if the daemon actually started successfully this library automatically pipes STDOUT/STDERR of your daemon process to STDOUT/STDERR of the parent process and provides a handle to your daemon process to manually detach itself from the parent process

Modules

Macros

Structs

handle returned from daemonize to the daemon process the daemon should use this handle to detach itself from the parent process, In cases where your program needs to run set up before starting this can be useful, as the daemon will pipe it’s stdout/stderr to the parent process to communicate if start up was successful

Functions

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