[olug] Alarms in Perl.

Daniel Linder dan at linder.org
Thu Oct 25 15:43:29 UTC 2007


I have a handful of scripts that are run periodically 24x7.  Nearly all
the time, they run fine and report their status back when they exit
correctly.  On the odd occasion (about once every 1-2 weeks), a script
will hang at some point in the code and never exit - most likely a call to
an external program that didn't complete or hung itself.  (The reason for
the hanging is not the point of this e-mail.)

What I would like to setup is a simple alarm based action that would exit
the script -- no matter what -- if it was still running after an extended
period of time.  (I.e. if a script that should only take ten seconds to
run has been running for five minutes, exit with a value of 99.)



More information about the OLUG mailing list