Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Perl daemon ?

by rcaputo (Chaplain)
on Nov 20, 2009 at 06:35 UTC ( [id://808348]=note: print w/replies, xml ) Need Help??


in reply to Perl daemon ?

Can you be clearer? Cron jobs are invoked by cron daemons. Are you writing a cron daemon in Perl?

Replies are listed 'Best First'.
Re^2: Perl daemon ?
by newbie01.perl (Sexton) on Nov 23, 2009 at 10:21 UTC

    Hi Ron,

    Nope, am not wanting to write a cron daemon. I think the response from baxy77bax is what am looking for unless you have another suggestion.

    Initially, am looking at scheduling the several scripts to run via cron but then our UNIX SA suggested that daemon'izing it is better.

    He doesn't suggest cron 'coz he said sometimes cron may not be running on some of the servers or the cron daemon itself may die which had happened in some occassions. I suppose the while (1) may be the trick, hopefully it does not become a rogue or runaway task or become defunct.

    I've also found a Daemon.pm, not sure if that is useful in anyc case.

      Consider using daemontools (see also thedjbway). They are essentially while(1) on steroids, completely eliminating any need to have daemon management, configuration, or logging code in your code. With daemontools, a simple daemon does not need more than 10 lines of shell code.

      And by the way: If a daemon like cron crashes and is not restarted automatically, either the machine's hardware or the OS setup is severely broken.

      What you you need the background process for? For some routine task that has to be done every N time-units? That's clearly a job for cron. No need to re-invent wheels, just wake up your lazy admin. Or do you need some service that responds to requests that may happen at any time? That's a job for a dedicated daemon, preferably under control of daemontools.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

        Hi Alexander,

        Right you are, wake up my lazy SA's ... :-) I wish I could. Believe it or not, they are not even alerted when their cron daemon dies ... ouch

        Thanks for the tips

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (1)
As of 2024-04-25 00:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found