|laziness, impatience, and hubris|
Pause and resume perl script with system killby Doozer (Beadle)
|on Nov 01, 2013 at 10:19 UTC||Need Help??|
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