summaryrefslogtreecommitdiff
path: root/FS/bin/freeside-queued
diff options
context:
space:
mode:
authorivan <ivan>2001-09-25 00:05:09 +0000
committerivan <ivan>2001-09-25 00:05:09 +0000
commit4ea8493d8422bd9b0d471da81e3c0cd164b9f12e (patch)
treed6d76f70d033c5e4006c8d07acee2c80bf0b96cd /FS/bin/freeside-queued
parenta08b4d18bc28e44fe236f1060632ffefc773f78b (diff)
better REAPER
Diffstat (limited to 'FS/bin/freeside-queued')
-rw-r--r--FS/bin/freeside-queued8
1 files changed, 3 insertions, 5 deletions
diff --git a/FS/bin/freeside-queued b/FS/bin/freeside-queued
index 1eef00c5c..35728db53 100644
--- a/FS/bin/freeside-queued
+++ b/FS/bin/freeside-queued
@@ -18,20 +18,18 @@ use Net::SSH;
my $pid_file = '/var/run/freeside-queued.pid';
-$SIG{CHLD} = sub { wait }; #zombie prevention
-
my $user = shift or die &usage;
&daemonize;
+sub REAPER { my $pid = wait; $SIG{CHLD} = \&REAPER; }
+$SIG{CHLD} = \&REAPER;
+
$sigterm = 0;
$sigint = 0;
$SIG{INT} = sub { warn "SIGINT received; shutting down\n"; $sigint++; };
$SIG{TERM} = sub { warn "SIGTERM received; shutting down\n"; $sigterm++; };
-#pickup zombie status
-$SIG{CHLD} = sub { wait; };
-
$> = $FS::UID::freeside_uid unless $>;
$< = $>;
$ENV{HOME} = (getpwuid($>))[7]; #for ssh