
Proc::Daemon - Run Perl program as a daemon process

use Proc::Daemon;
Proc::Daemon::Init;

This module contains the routine Init which can be called by a Perl program to initialize itself as a daemon. A daemon is a process that runs in the background with no controlling terminal. Generally servers (like FTP and HTTP servers) run as daemon processes. Note, do not make the mistake that a daemon == server.
The Proc::Daemon::Init function does the following:
You will notice that no logging facility, or other functionality is performed. Proc::Daemon::Init just performs the main steps to initialize a program as daemon. Since other funtionality can vary depending on the nature of the program, Proc::Daemon leaves the implementation of other desired functionality to the caller, or other module/library (like Sys::Syslog).
There is no meaningful return value Proc::Daemon::Init. If an error occurs in Init so it cannot perform the above steps, than it croaks with an error message. One can prevent program termination by using eval.

Proc::Daemon also defines some other functions. These functions can be imported into the callers name space if the function names are specified during the use declaration:
Fork is like the built-in fork, but will try to fork if at all possible, retrying if necessary. If not possible, Fork will croak.
OpenMax returns the maximum file descriptor number. If undetermined, 64 will be returned.


Earl Hood, earl@earlhood.com

Implementation of Proc::Daemon derived from the following sources:

Carp, POSIX.
