[squid-dev] [PATCH] BUg 4466: removal of -k kill command
Amos Jeffries
squid3 at treenet.co.nz
Tue Mar 29 16:22:31 UTC 2016
The Squid "-k kill" command line option is equivalent to "kill -9" on
whatever process has its PID in the .pid file.
Since Squid gained multi-process SMP support it has been declining in
usefulness, and with recent changes to make thee master process be the
one operating the .pid file this command has effectively become irrelevant.
Since admin have the "kill -9" command available anyway and also have
better understanding of what will happen when using that command I
propose removing "squid -k kill" entirely.
The attached patch implements that.
Amos
-------------- next part --------------
=== modified file 'src/ipc/Kid.cc'
--- src/ipc/Kid.cc 2016-01-01 00:12:18 +0000
+++ src/ipc/Kid.cc 2016-03-29 15:41:46 +0000
@@ -81,7 +81,6 @@
exitedHappy() ||
hopeless() ||
shutting_down ||
- signaled(SIGKILL) || // squid -k kill
signaled(SIGINT) || // unexpected forced shutdown
signaled(SIGTERM)); // unexpected forced shutdown
}
=== modified file 'src/main.cc'
--- src/main.cc 2016-03-03 00:49:45 +0000
+++ src/main.cc 2016-03-29 15:30:47 +0000
@@ -367,7 +367,7 @@
#ifdef SIGTTIN
"restart|"
#endif
- "interrupt|kill|debug|check|parse\n"
+ "interrupt|debug|check|parse\n"
" Parse configuration file, then send signal to \n"
" running copy (except -k parse) and exit.\n"
" -n name Specify service name to use for service operations\n"
@@ -549,10 +549,6 @@
else if (!strncmp(optarg, "interrupt", strlen(optarg)))
/** \li On interrupt send SIGINT. */
opt_send_signal = SIGINT;
- else if (!strncmp(optarg, "kill", strlen(optarg)))
- /** \li On kill send SIGKILL. */
- opt_send_signal = SIGKILL;
-
#ifdef SIGTTIN
else if (!strncmp(optarg, "restart", strlen(optarg)))
=== modified file 'src/squid.8.in'
--- src/squid.8.in 2016-02-24 23:55:48 +0000
+++ src/squid.8.in 2016-03-29 15:34:52 +0000
@@ -97,7 +97,7 @@
option).
.
.if !'po4a'hide' .TP
-.if !'po4a'hide' .B "\-k reconfigure | rotate | shutdown | interrupt | kill | debug | check | parse"
+.if !'po4a'hide' .B "\-k reconfigure | rotate | shutdown | interrupt | debug | check | parse"
Parse configuration file, then send signal to running copy
(except
.B "\-k parse"
=== modified file 'tools/sysvinit/squid.rc'
--- tools/sysvinit/squid.rc 2016-01-01 00:12:18 +0000
+++ tools/sysvinit/squid.rc 2016-03-29 16:06:45 +0000
@@ -95,20 +95,20 @@
fi
;;
-stop)
+stop|shutdown)
config || exit 2 # Squid not enabled
squid ${SQUID_OPTIONS-} -k shutdown || exit 1
;;
-reconf*|rotate|int*|debug|check|kill)
+reconf*|rotate|int*|debug|check)
config
squid ${SQUID_OPTIONS-} -k "$1"
;;
*)
- echo "usage: $0 {start|stop|reconfigure|rotate|interrupt|debug|check|kill}" >&2
+ echo "usage: $0 {start|stop|reconfigure|rotate|interrupt|debug|check}" >&2
echo " start start squid" >&2
echo " stop clean shutdown" >&2
echo " reconfigure reread configuration files" >&2
@@ -116,7 +116,6 @@
echo " interrupt quick clean shutdown " >&2
echo " debug toggle debug logging" >&2
echo " check check for running squid" >&2
- echo " kill terminate squid by brute force" >&2
exit 1
;;
More information about the squid-dev
mailing list