[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Perl Daemon



It might depend on your projects needs.  We have two daemon-like processes.  One listens on a TCP/IP port 24x7, but just in case it dies we have it setup in a cronjob to try and execute once a minute.  It's not elegant, but it works for us.

The second process isn't a daemon per-se.  We just run it from cron at 10 minute intervals and it processes anything that it finds in it's directory.  Since the processing time can take quite a while, we put a flag file in the directory when we start, and delete it when we're done.

I think the first one is the daemon-like example you're looking for.  Check out your distributions init.d scripts and start there.

Dan

On Fri, Jun 11, 2010 at 14:07, Jay Hannah <jay@jays.net> wrote:
On 6/11/2010 1:03 PM, Todd Hamilton wrote:
What module or approach do you guys use to Daemonize a perl application?

We've got a bunch of home-spun .sh reminiscent of /etc/init.d/apache2 and friends. I'm sure there's prettier ways, but I've never used one. If you find one you like tell us about it.   :)


j

_______________________________________________
Omaha-pm mailing list
Omaha-pm@pm.org
http://mail.pm.org/mailman/listinfo/omaha-pm



--
***************** ************* *********** ******* ***** *** **
"Quis custodiet ipsos custodes?"
   (Who can watch the watchmen?)
   -- from the Satires of Juvenal
"I do not fear computers, I fear the lack of them."
   -- Isaac Asimov (Author)
** *** ***** ******* *********** ************* *****************