Depending on the number of child processes and their busy state, the spamd master process can take some time to shut down. start-stop-daemon does currently not take this into account, causing /etc/init.d/spamd stop and restart to occasionally (in my experience, frequently) exit with [FAILED]. (spamd, having received the signal, exits some time later.) Reproducible: Always Actual Results: # /etc/init.d/spamd restart * Stopping spamd ... * Failed to stop spamd [ !! ] * ERROR: spamd failed to stop # ps -ef | grep [s]pamd root 5037 1 0 May27 ? 00:00:39 /usr/sbin/spamd -d -r /var/run/spamd.pid -m 5 --min-spare=3 --min-children=3 -x -l -H -u qscand qscand 5778 5037 0 May27 ? 00:04:26 [spamd] <defunct> qscand 5779 5037 0 May27 ? 00:00:10 [spamd] <defunct> qscand 5780 5037 0 May27 ? 00:00:00 [spamd] <defunct> qscand 22103 5037 0 01:41 ? 00:00:00 [spamd] <defunct> ### wait a little # ps -ef | grep [s]pamd # _ Expected Results: init script should wait for spamd to shutdown cleanly, at least when restarting.
Hello Peter, tanks for the report. In general it would be nice to get the version of the failing package, but according to the two files inside /usr/portage/mail-filter/spamassassin/files/ this doesn't matter in this case. Michael
Please include the version you are using. 3.2.5-r2 uses 3.0.0-spamd.init and 3.3.1-r2 uses 3.3.1-spamd.init thanks
(In reply to comment #2) > Please include the version you are using. 3.2.5-r2 uses 3.0.0-spamd.init and > 3.3.1-r2 uses 3.3.1-spamd.init > thanks > Sorry for the late reply. I am using 3.3.1 however both init scripts use the same stop() function/call to start-stop-daemon so both will have the same problem. I added --retry 15 to the start-stop-daemon call which does not fix the underlying problem but hides it well enough for me. YMMV, HTH
if spamd is not running as root, then pid file must be in a subdir in /var/run/<initname>/spamd.pid else spamd cant remove pid file
The latest -r5 introduces a new conf variable called SPAMD_TIMEOUT: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19ff5b04b9db6b1319b35e9a6da3d26972bf04b5 When stopping spamd, we use --retry with a value of SPAMD_TIMEOUT and it defaults to 15 seconds. That seems to work, but I'm not a heavy user of spamd, so please reopen if that doesn't fix the issue.