- or download this
my $fullcmd="nohup sh -c \"($cmd)\" &";
debug(DWRN, "Process is not running, attempting to restart using '
+$fullcmd'\n");
qx/$fullcmd/;
debug(DDBG, "Process is restarted, next poll in $interval seconds\
+n");
- or download this
~$ perl bin/restart_app --cmd "sleep 5" -vvv "sleep"
...<snip>...
17:14:49 D1 Process is not running, attempting to restart using 'nohup
+ sh -c "(sleep 5)" &'
17:14:54 D2 Process is restarted, next poll in 2 seconds
...<snip>...
- or download this
my $finish = time + $run;
my $restarts=0;
...
my $fullcmd="nohup sh -c \"($cmd)\" &";
system($fullcmd);
}