Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Writing a Perl Daemon

by jdhedden (Deacon)
on Jul 28, 2005 at 13:58 UTC ( [id://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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-23 10:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found