From 069afc67ef4b89761df6437d68ab021542fb9260 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Kr=C3=BCger?= Date: Wed, 24 Nov 2010 18:12:06 +0100 Subject: [PATCH] jobd: add --restart-delay option MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- jobd/jobd.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.11.4.GIT