lib/PublicInbox/Daemon.pm | 2 ++ diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index c3199cd24f0a9859261408fe479edf535b916544..30411e13d5977b71fed743e0f765fcba289ee5a9 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -109,6 +109,7 @@ # We change users in the worker to ensure upgradability, # The upgrade will create the ".oldbin" pid file in the # same directory as the given pid file. $uid and $set_user = sub { + $set_user = undef; Net::Server::Daemonize::set_user($uid, $gid); }; @@ -128,6 +129,7 @@ if (defined $pid_file) { write_pid($pid_file); my $unlink_pid = $$; $cleanup = sub { + $cleanup = undef; # avoid cyclic reference unlink_pid_file_safe_ish($unlink_pid, $pid_file); }; }