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

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?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2015-11-27 22:42 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (734 votes), past polls