]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Allow sending "squid -k ..." signals to PID 1 (#863)
authorJonathan Newton <jwcnewton@gmail.com>
Fri, 23 Jul 2021 07:03:26 +0000 (07:03 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 23 Jul 2021 16:13:08 +0000 (16:13 +0000)
Inside a container, Squid usually runs with PID=1. Since "squid -k"
feature was added in 1996 (commit 7690e8e), Squid refused to signal a
PID=1 instance. We do not know why, and it could have been an accident.
We cannot find a good reason to keep prohibiting such signalling.

src/Instance.cc

index 2b95b777377a2316ffa99a9586fa8cb583743627..7ddbaf6367637039a914b412a9e60017e380abb9 100644 (file)
@@ -81,7 +81,7 @@ GetOtherPid(File &pidFile)
 
     debugs(50, 7, "found PID " << rawPid << " in " << TheFile);
 
-    if (rawPid <= 1)
+    if (rawPid < 1)
         throw TexcHere(ToSBuf("Bad ", TheFile, " contains unreasonably small PID value: ", rawPid));
     const auto finalPid = static_cast<pid_t>(rawPid);
     if (static_cast<int64_t>(finalPid) != rawPid)