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 ?
Thanks
Dave
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.