Doozer has asked for the wisdom of the Perl Monks concerning the following question:
I was after some input on the benefits/risks/problems when using the 'kill' function in linux to pause and resume a perl script.
"kill -STOP (PID)" will pause any running process until the command "kill -CONT (PID)" is given.
The reason this may be useful for me is that I have a perl script that starts 4 other scripts and puts them in to the background. The scripts run for 72 hours (They all work together to run a 'load test' on a router) before finishing.
I need to have a process whereby all of the scripts are paused when a problem is detected with the router such as ADSL line drops or complete failure. I have built pause functions in to scripts before but it can be time consuming to work out the logic and put it in to all 4 scripts, so using the system to just pause the running scripts would be much easier and quicker.
I would guess it depends on what the scripts do as to how good or bad this method of pausing could be but I would appreciate your thoughts
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Pause and resume perl script with system kill
by kcott (Archbishop) on Nov 01, 2013 at 12:27 UTC | |
Re: Pause and resume perl script with system kill
by sundialsvc4 (Abbot) on Nov 01, 2013 at 14:51 UTC |