From 65bd1958a1df3a980e97106faef6a4640c21508d Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Fri, 16 Feb 2018 10:47:37 -0800 Subject: [PATCH] taskd.pl: minor help cleanup * fix a typo * move description section earlier * avoid setting SIGCHLD until after pod2usage calls Signed-off-by: Kyle J. McKay --- taskd/taskd.pl | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/taskd/taskd.pl b/taskd/taskd.pl index 1d11b96..d1e8bf3 100755 --- a/taskd/taskd.pl +++ b/taskd/taskd.pl @@ -576,7 +576,9 @@ sub REAPER { $SIG{CHLD} = \&REAPER; # loathe sysV } -$SIG{CHLD} = \&REAPER; # Apollo 440 +sub set_sigchld_reaper() { + $SIG{CHLD} = \&REAPER; # Apollo 440 +} my ($piperead, $pipewrite); sub spawn { @@ -1245,6 +1247,7 @@ if ($quiet) { my ($NAME, $INO); +set_sigchld_reaper; my $restart_file = $Girocco::Config::chroot.'/etc/taskd.restart'; my $restart_active = 1; my $resumefd = $ENV{(SOCKFDENV)}; @@ -1463,7 +1466,7 @@ while (1) { chdir "/"; cancel_jobd_restart($restarter) if $restarter; statmsg "RESTART: scheduled jobd restart has been cancelled" if $restarter; - $SIG{CHLD} = \&REAPER; + set_sigchld_reaper; } } if ($idle_timeout && !$children && !$nfound && $now - $idlestart >= $idle_timeout) { @@ -1572,6 +1575,12 @@ taskd.pl [options] --status-interval=MINUTES status update interval (default 1) --idle-status-interval=IDLEMINUTES idle status interval (default 60) +=head1 DESCRIPTION + +taskd.pl is Girocco's service request servant; it listens for service requests +such as new clone requests and ref update notifications and spawns a task to +perform the requested action. + =head1 OPTIONS =over 8 @@ -1639,7 +1648,7 @@ processed it will end up in a new pid anyway. After taskd has been running for SECONDS of realtime, it will behave as though a graceful restart has been requested. A graceful restart takes place the next time taskd becomes idle (which may require up to 60 seconds to notice). -If jobd is running when a graceful restart occurs, then jabd will also receive +If jobd is running when a graceful restart occurs, then jobd will also receive a graceful restart request at that time. The default value is 1 week (604800), set to 0 to disable. @@ -1705,10 +1714,4 @@ activity between them) from appearing at all. =back -=head1 DESCRIPTION - -taskd.pl is Girocco's service request servant; it listens for service requests -such as new clone requests and ref update notifications and spawns a task to -perform the requested action. - =cut -- 2.11.4.GIT