diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-03-13 21:40:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-13 21:40:31 +0100 |
commit | 00a44e83c9b1c37b94e2504a06c981535bb51623 (patch) | |
tree | 857b3f8eaa36a392e6e3f9132bb249c26502b05a /jobqueue-worker.pl | |
parent | 6738d7497baeef5c21d4cfa0686bab10b1194815 (diff) | |
download | bugzilla-00a44e83c9b1c37b94e2504a06c981535bb51623.tar.gz bugzilla-00a44e83c9b1c37b94e2504a06c981535bb51623.tar.xz |
Bug 1441181 - Step 9 - use pdeathsig to prevent workers running without supervision
Diffstat (limited to 'jobqueue-worker.pl')
-rw-r--r-- | jobqueue-worker.pl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/jobqueue-worker.pl b/jobqueue-worker.pl index 6205e1bf4..b26aacdba 100644 --- a/jobqueue-worker.pl +++ b/jobqueue-worker.pl @@ -24,8 +24,9 @@ BEGIN { use Bugzilla::JobQueue::Worker; use Bugzilla::JobQueue; use Bugzilla; -use English qw(-no_match_vars $PROGRAM_NAME); +use English qw(-no_match_vars $PROGRAM_NAME $OSNAME); use Getopt::Long qw(:config gnu_getopt); +use if $OSNAME eq 'linux', 'Linux::Pdeathsig', 'set_pdeathsig'; BEGIN { Bugzilla->extensions } my $name = basename(__FILE__); @@ -37,4 +38,10 @@ if ($name) { $PROGRAM_NAME = $name; ## use critic } + +if ($OSNAME eq 'linux') { + # get SIGTEMR (15) when parent exits. + set_pdeathsig(15); +} + Bugzilla::JobQueue::Worker->run('work'); |