mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-18 03:08:54 -04:00
Handle expected signals in tsiggss authsock.pl script
When the authsock.pl script would be terminated with a signal, it would leave the pidfile around. This commit adds a signal handler that cleanups the pidfile on signals that are expected.
This commit is contained in:
parent
f8c6872beb
commit
216a97188d
1 changed files with 5 additions and 0 deletions
|
|
@ -42,6 +42,11 @@ open(my $pid,">",$pidfile)
|
|||
print $pid "$$\n";
|
||||
close($pid);
|
||||
|
||||
# close gracefully
|
||||
sub rmpid { unlink "$pidfile"; exit 1; };
|
||||
$SIG{INT} = \&rmpid;
|
||||
$SIG{TERM} = \&rmpid;
|
||||
|
||||
if ($timeout != 0) {
|
||||
# die after the given timeout
|
||||
alarm($timeout);
|
||||
|
|
|
|||
Loading…
Reference in a new issue