|XP is just a number|
Disowning CRONby daveime (Novice)
|on Jun 05, 2003 at 15:06 UTC||Need Help??|
daveime has asked for the
wisdom of the Perl Monks concerning the following question:
Under Linux Redhat 7.something, Perl 5.6.something, when a perl script is triggered by a crontab entry, how can i then cause the script to disown it's parent and act as an orphan.
I need this as I'm writing a Perl DAEMON, and I need cron to "kick the DAEMON" every 20 minutes to see if it's still alive.
So my DAEMON script itself is triggered by crontab every 20 mins, the first thing it does is look for another instance of DAEMON running, if it finds one then this instance exits immediately.
If there is no other instance running, this script has to become the new DAEMON, so I then need to disown it from it's parent cron so that cron doesn't hang waiting for the DAEMON to finish (which it shouldn't do !!).
(If this isn't the most garbled nonsense I ever wrote !)
Please help, someone ?