We need to track the PID file having ".oldbin" appended
to it while a SIGUSR2 upgrade is in progress and ensure
it is unlinked on SIGQUIT.
write_pid($pid_file);
# for ->DESTROY:
- bless { pid => $$, pid_file => $pid_file }, __PACKAGE__;
+ bless { pid => $$, pid_file => \$pid_file }, __PACKAGE__;
}
sub worker_quit { # $_[0] = signal name or number (unused)
}
sub DESTROY {
- unlink_pid_file_safe_ish($_[0]->{pid}, $_[0]->{pid_file});
+ unlink_pid_file_safe_ish($_[0]->{pid}, ${$_[0]->{pid_file}});
}
1;
# drop the old parent
kill('QUIT', $old_pid) or die "QUIT failed: $!";
delay_until(sub { !kill(0, $old_pid) });
+ ok(!-f "$pid_file.oldbin", '.oldbin PID file gone');
# drop the new child
check_sock($unix);