MAN page from Mandrake Other perl-Proc-Daemon-0.01-1.i386.rpm
Daemon
Section: User Contributed Perl Documentation (3)
Updated: perl 5.004, patch 04
Index NAME
Proc::Daemon - Run Perl programs as daemon process
SYNOPSIS
use Proc::Daemon; $sess_id = Proc::Daemon::init;
## ... your code here ...
DESCRIPTION
This module contains the routine
init which can be called by a perlprogram to initialize itself as a daemon. The routine achieves thisby the following:
- 1
- Forks a child and exits the parent process.
- 2
- Becomes a session leader (which detaches the program fromthe controlling terminal).
- 3
- Changes the current working directory to ``/''.
- 4
- Clears the file creation mask.
The calling program is responible for closing unnecessary openfile handles.
The return value is the session id returned from setsid().
If an error occurs in init so it cannot perform the above steps, thanit croaks with an error message. One can prevent program terminationby using eval.
AUTHOR
Earl Hood, ehoodAATTmedusa.acs.uci.edu
http://www.oac.uci.edu/indiv/ehood/
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- AUTHOR
This document was created byman2html,using the manual pages.