]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
event handler to FORCE shutdown
authorwessels <>
Thu, 23 Jul 1998 09:13:24 +0000 (09:13 +0000)
committerwessels <>
Thu, 23 Jul 1998 09:13:24 +0000 (09:13 +0000)
src/main.cc

index 650b66549003e444845017975bec29d0d60ec7b4..e0b7f3d43398ad85efce5d089a58ab46f6576b79 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.258 1998/07/22 20:37:33 wessels Exp $
+ * $Id: main.cc,v 1.259 1998/07/23 03:13:24 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -68,6 +68,7 @@ static void normal_shutdown(void);
 extern void log_trace_done();
 extern void log_trace_init(char *);
 #endif
+static EVH force_shutdown;
 
 static void
 usage(void)
@@ -546,12 +547,14 @@ main(int argc, char **argv)
            mainRotate();
            do_rotate = 0;
        } else if (do_shutdown) {
+           time_t wait = do_shutdown > 0 ? (int) Config.shutdownLifetime : 0;
            debug(1, 1) ("Preparing for shutdown after %d requests\n",
                Counter.client_http.requests);
            debug(1, 1) ("Waiting %d seconds for active connections to finish\n",
-               do_shutdown > 0 ? (int) Config.shutdownLifetime : 0);
+               wait);
            do_shutdown = 0;
            shutting_down = 1;
+           eventAdd("force_shutdown", force_shutdown, (double) (wait+1), 1);
        }
        eventRun();
        if ((loop_delay = eventNextTime()) < 0)
@@ -722,3 +725,10 @@ normal_shutdown(void)
     fclose(debug_log);
     exit(0);
 }
+
+static void
+force_shutdown(void *unused)
+{
+    fdDumpOpen();
+    fatal_dump("Shutdown procedure failed");
+}