From: Jan Krüger Date: Wed, 24 Nov 2010 17:12:06 +0000 (+0100) Subject: jobd: add --restart-delay option X-Git-Url: https://repo.or.cz/w/girocco.git/commitdiff_plain/069afc67ef4b89761df6437d68ab021542fb9260 jobd: add --restart-delay option For busy systems, it's probably desirable to be able to configure how long jobd sleeps between queue runs, in order to give other running processes more breathing room. Signed-off-by: Jan Krüger --- diff --git a/jobd/jobd.pl b/jobd/jobd.pl index 86f8209..0d3a3af 100755 --- a/jobd/jobd.pl +++ b/jobd/jobd.pl @@ -22,7 +22,7 @@ my $kill_after = 900; my $max_par = 20; my $max_par_intensive = 1; my $lockfile = "/tmp/jobd.lock"; -my $restart_delay = 10; # not currently configurable +my $restart_delay = 60; my $all_once; my $one; @@ -324,6 +324,7 @@ my $parse_res = GetOptions( 'kill-after|k=i' => \$kill_after, 'max-parallel|p=i' => \$max_par, 'max-intensive-parallel|i=i' => \$max_par_intensive, + 'restart-delay|d=i' => \$restart_delay, 'lockfile|l=s' => \$lockfile, 'all-once|a' => \$all_once, 'one|o=s' => \$one, @@ -370,6 +371,8 @@ jobd [options] -p NUM | --max-parallel=NUM how many jobs to run at the same time -i NUM | --max-intensive-parallel=NUM how many resource-hungry jobs to run at the same time + -d NUM | --restart-delay=NUM wait for this many seconds between + queue runs -l FILE | --lockfile=FILE create a lockfile in the given location -a | --all-once process the list only once @@ -405,6 +408,11 @@ Run no more than that many jobs at the same time. Run no more than that many resource-hungry jobs at the same time. Right now, this refers to repacking jobs. +=item B<--restart-delay=NUM> + +After processing the queue, wait this many seconds until the queue is +restarted. + =item B<--lockfile=FILE> For perpetual operation, create a lockfile in that place and clean it up after