lib/PublicInbox/Daemon.pm | 4 ++-- t/httpd-unix.t | 1 + diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index 3d582e355ed70d40f6b9689f791f5e08f0c81d67..4ff7cad493990d81c6ce4d2e896f63cfe7a87032 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -247,7 +247,7 @@ return unless defined $pid_file; 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) @@ -663,7 +663,7 @@ do_chown($path); } sub DESTROY { - unlink_pid_file_safe_ish($_[0]->{pid}, $_[0]->{pid_file}); + unlink_pid_file_safe_ish($_[0]->{pid}, ${$_[0]->{pid_file}}); } 1; diff --git a/t/httpd-unix.t b/t/httpd-unix.t index 02f5e4a9a7077515f40f6bd7558a0aaca06bf99f..a0fe1e31c97541c37b3ded69e0de68b4d8db9399 100644 --- a/t/httpd-unix.t +++ b/t/httpd-unix.t @@ -163,6 +163,7 @@ # 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);