Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Creating a perl daemon

by Zaxo (Archbishop)
on Jul 14, 2004 at 21:34 UTC ( #374449=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use POSIX 'setsid';
    use Cwd 'chdir';
    
    sub daemon_init {
    
  2. or download this
        my $pid = fork;
        exit 0 if $pid;
        exit 1 if not defined $pid;
    
  3. or download this
        setsid();
        $pid = fork;
        exit 0 if $pid;
        exit 1 if not defined $pid;
    
  4. or download this
        chdir '/' or die $!;
  5. or download this
        umask 0;
  6. or download this
        close $_ for @_;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://374449]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2021-03-02 11:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (42 votes). Check out past polls.

    Notices?