Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: process monitoring script

by AnomalousMonk (Archbishop)
on Apr 14, 2018 at 17:04 UTC ( [id://1212881]=note: print w/replies, xml ) Need Help??


in reply to process monitoring script

Further to marto's reply:   As a basic introduction, see perlintro. Also see the articles in the Getting Started with Perl and Getting Deeper Into Perl sections of the monastery's Tutorials wing. My first thought would be something along the lines of

while (1) { while (process_is_still_going()) { sleep 30; } restart_the_process(); }
(Note that the infinite  while (1) { ... } loop has no way to ever end the program.) See Compound Statements in perlsyn for info on while-loops. See sleep. This loop calls subroutines; see perlsub.

Please try to come up with some code. The closer it is to something we can play with too, the better; see Short, Self-Contained, Correct Example. When you have some code about which you still have questions, please come back and we'll see if we can answer those questions.


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1212881]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-03-29 14:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found