Help for this page

Select Code to Download


  1. 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");
    
  2. 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>...
    
  3. or download this
    my $finish = time + $run;
    my $restarts=0;
    ...
        my $fullcmd="nohup sh -c \"($cmd)\" &";
        system($fullcmd);
      }