]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Remove --enable-kill-parent-hack (#1178)
authorAmos Jeffries <yadij@users.noreply.github.com>
Thu, 10 Nov 2022 05:56:30 +0000 (05:56 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 10 Nov 2022 05:56:33 +0000 (05:56 +0000)
This feature has been deprecated for some time.

The useful functionality can more safely be implemented in the parent
script by using the --foreground command line option and waiting for
the Squid process to exit.

It has always been labeled dangerous as the parent process can be
PID 1 or some other vital system process than the intended
RunCache script. Currently it breaks SMP support for manually
killing a single worker or disker process.

configure.ac
doc/release-notes/release-6.sgml
src/main.cc
test-suite/buildtests/layer-01-minimal.opts
test-suite/buildtests/layer-02-maximus.opts
test-suite/buildtests/layer-04-noauth-everything.opts

index cf01c9a66e788d1ee9363ba99c3a103a472a2e5b..518fa9b1abf23cf59bf6a0f85bd5cc0347391243 100644 (file)
@@ -960,16 +960,6 @@ SQUID_DEFINE_BOOL(USE_WCCPv2,${enable_wccpv2:=yes},
             [Define to enable WCCP V2])
 AC_MSG_NOTICE([Web Cache Coordination V2 Protocol enabled: $enable_wccpv2])
 
-AC_ARG_ENABLE(kill-parent-hack,
-  AS_HELP_STRING([--enable-kill-parent-hack],[Kill parent on shutdown]), [
-  SQUID_YESNO([$enableval],[--enable-kill-parent-hack])
-])
-SQUID_DEFINE_BOOL(KILL_PARENT_OPT,${enable_kill_parent_hack:=no},
-                   [A dangerous feature which causes Squid to kill its parent
-                    process (presumably the RunCache script) upon receipt
-                    of SIGTERM or SIGINT. Deprecated, Use with caution.])
-AC_MSG_NOTICE([Kill parent on shutdown hack enabled: $enable_kill_parent_hack])
-
 AC_ARG_ENABLE(snmp,
   AS_HELP_STRING([--disable-snmp],[Disable SNMP monitoring support]), [
   SQUID_YESNO([$enableval],[--enable-snmp])
index 65c5daeb2e90c6be91e5f808166004b61f407487..e015ed354858618d9a9036c310c4ea062acafc3e 100644 (file)
@@ -126,6 +126,10 @@ This section gives an account of those changes in three categories:
        <p>This feature has been unreliable for many years. Other tools such as
           oprofile provide better tracking and should be used instead.
 
+       <tag>--enable-kill-parent-hack</tag>
+       <p>This feature has been deprecated for years. Other features such as
+          <em>--foreground</em> command line argument should be used instead.
+
        <tag>--disable-loadable-modules</tag>
        <p>This option was performing the same duties as <em>--disable-shared</em>.
 
index 74fe2a08965c7dc444dadefeec863371c607b53b..f940f48982c46c97d78a8d7573c05a31e773b826 100644 (file)
@@ -197,12 +197,6 @@ class SignalEngine: public AsyncEngine
 {
 
 public:
-#if KILL_PARENT_OPT
-    SignalEngine(): parentKillNotified(false) {
-        parentPid = getppid();
-    }
-#endif
-
     virtual int checkEvents(int timeout);
 
 private:
@@ -225,11 +219,6 @@ private:
 
     void doShutdown(time_t wait);
     void handleStoppedChild();
-
-#if KILL_PARENT_OPT
-    bool parentKillNotified;
-    pid_t parentPid;
-#endif
 };
 
 int
@@ -286,23 +275,10 @@ SignalEngine::doShutdown(time_t wait)
     debugs(1, Important(2), "Preparing for shutdown after " << statCounter.client_http.requests << " requests");
     debugs(1, Important(3), "Waiting " << wait << " seconds for active connections to finish");
 
-#if KILL_PARENT_OPT
-    if (!IamMasterProcess() && !parentKillNotified && ShutdownSignal > 0 && parentPid > 1) {
-        debugs(1, DBG_IMPORTANT, "Killing master process, pid " << parentPid);
-        if (kill(parentPid, ShutdownSignal) < 0) {
-            int xerrno = errno;
-            debugs(1, DBG_IMPORTANT, "kill " << parentPid << ": " << xstrerr(xerrno));
-        }
-        parentKillNotified = true;
-    }
-#endif
-
     if (shutting_down) {
-#if !KILL_PARENT_OPT
         // Already a shutdown signal has received and shutdown is in progress.
         // Shutdown as soon as possible.
         wait = 0;
-#endif
     } else {
         shutting_down = 1;
 
index 046079938523a6e45e394824307bb12b561e7517..5720022e34c3d90848f58f5187f8cffb5b8bf59d 100644 (file)
@@ -55,7 +55,6 @@ DISTCHECK_CONFIGURE_FLAGS=" \
        --disable-referer-log \
        --disable-wccp \
        --disable-wccpv2 \
-       --disable-kill-parent-hack \
        --disable-snmp \
        --disable-cachemgr-hostname \
        --disable-eui \
index 22874e9723a4263e7c4eb3d3838c00a2a8b4f0ab..3ddd17337137b996976293fe2649118faa4eb0dc 100644 (file)
@@ -73,7 +73,6 @@ DISTCHECK_CONFIGURE_FLAGS=" \
        --enable-referer-log \
        --enable-wccp \
        --enable-wccpv2 \
-       --enable-kill-parent-hack \
        --enable-snmp \
        --enable-cachemgr-hostname \
        --enable-eui \
index 34972050f82f4945bd56f822547a4307c7f166f2..552c210f55f85c1642edf93c68a507cda39bc11f 100644 (file)
@@ -73,7 +73,6 @@ DISTCHECK_CONFIGURE_FLAGS=" \
        --enable-referer-log \
        --enable-wccp \
        --enable-wccpv2 \
-       --enable-kill-parent-hack \
        --enable-snmp \
        --enable-cachemgr-hostname \
        --enable-eui \