in reply to Re: Perl daemon ?
in thread Perl daemon ?

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.

Replies are listed 'Best First'.
Re^3: Perl daemon ?
by afoken (Chancellor) on Nov 23, 2009 at 16:31 UTC

    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