From ab50ee9e8a39e79693b8cf5fa6d49c8c540b8d2c Mon Sep 17 00:00:00 2001 From: hno <> Date: Sat, 1 Feb 2003 20:36:09 +0000 Subject: [PATCH] Delay unlinking of the pid file to after where the services of Squid have shut down and the swap has been flushed. This allows scripts to use "squid -k check" to determine if/when Squid has shut down. In the long run we should probably extend "squid -k shutdown" with such check to ensure clean shutdowns. --- src/main.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.cc b/src/main.cc index 8ded205db0..84f4b62b41 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.362 2003/01/23 00:37:23 robertc Exp $ + * $Id: main.cc,v 1.363 2003/02/01 13:36:09 hno Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -935,11 +935,6 @@ static void SquidShutdown(void *unused) { debug(1, 1) ("Shutting down...\n"); - if (Config.pidFilename && strcmp(Config.pidFilename, "none")) { - enter_suid(); - safeunlink(Config.pidFilename, 0); - leave_suid(); - } icpConnectionClose(); #if USE_HTCP htcpSocketClose(); @@ -1002,6 +997,11 @@ SquidShutdown(void *unused) #if MEM_GEN_TRACE log_trace_done(); #endif + if (Config.pidFilename && strcmp(Config.pidFilename, "none") != 0) { + enter_suid(); + safeunlink(Config.pidFilename, 0); + leave_suid(); + } debug(1, 1) ("Squid Cache (Version %s): Exiting normally.\n", version_string); if (debug_log) -- 2.47.3