Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Writing a Perl Daemon

by jdhedden (Deacon)
on Jul 28, 2005 at 13:58 UTC ( #478977=note: print w/ replies, xml ) Need Help??


in reply to Writing a Perl Daemon

cees' example above is extremely comprehensive, but here's something to show just the bare bones of what's needed.

#!/usr/bin/perl use strict; use warnings; use Proc::Daemon; use Proc::PID::File; MAIN: { # Daemonize Proc::Daemon::Init(); # If already running, then exit if (Proc::PID::File->running()) { exit(0); } # Perform initializes here # Enter loop to do work for (;;) { # Do whatcha gotta do } }

Remember: There's always one more bug.


Comment on Re: Writing a Perl Daemon
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2014-09-20 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (159 votes), past polls