From: Dmitry Kurochkin Date: Wed, 30 Mar 2011 20:50:00 +0000 (-0600) Subject: Do not send signals from the master process to parent on shutdown. X-Git-Tag: take06~27^2~48 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bd9fe5b471063353dd89cbd70facb4db61c0c980;p=thirdparty%2Fsquid.git Do not send signals from the master process to parent on shutdown. Trunk r11330 introduced a bug: When running in non-daemon mode, Squid sends SIGUSR1 signal to the parent process on shutdown. This results in shell (at least zsh) exit when Squid is interrupted with C-c. The patch adds a check to prevent the master process from killing it's parent on shutdown. Same check added for the kill-parent hack. --- diff --git a/src/main.cc b/src/main.cc index ffc2332068..8966c83e5b 100644 --- a/src/main.cc +++ b/src/main.cc @@ -617,7 +617,7 @@ shut_down(int sig) const pid_t ppid = getppid(); - if (ppid > 1) { + if (!IamMasterProcess() && ppid > 1) { // notify master that we are shutting down if (kill(ppid, SIGUSR1) < 0) debugs(1, DBG_IMPORTANT, "Failed to send SIGUSR1 to master process," @@ -627,7 +627,7 @@ shut_down(int sig) #ifndef _SQUID_MSWIN_ #if KILL_PARENT_OPT - if (ppid > 1) { + if (!IamMasterProcess() && ppid > 1) { debugs(1, DBG_IMPORTANT, "Killing master process, pid " << ppid); if (kill(ppid, sig) < 0)