Table of Contents

Name

daemonize - make a prog a daemon

Synopsis

daemonize prog [args]

Description

Make a prog, shell- or other script a daemon. The new daemon will be a session leader with umask of 0, "/" as directory and standard file descriptors closed.
To avoid unnecessary library dependencies the binary was created with nasm (dietlibc created binaries fail on some grsec kernels).

Return Value

The return value is 1 if forking failed. If executing the prog failed it will be 2. On success 0 is the result.

Examples

daemonize loadlogger.py

Caveats

Only the standard file descriptors for stdin, stdout and stderrr (0,1,2) are closed.

Author

Frank Bergmann, http://www.tuxad.com


Table of Contents