Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 322025 - mail-filter/spamassassin: spamd init script should wait for spamd childs to exit
Summary: mail-filter/spamassassin: spamd init script should wait for spamd childs to exit
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 583908
  Show dependency tree
 
Reported: 2010-05-29 19:49 UTC by Peter Gantner (a.k.a. nephros)
Modified: 2016-06-04 15:40 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Gantner (a.k.a. nephros) 2010-05-29 19:49:07 UTC
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.
Comment 1 Michael Weber (RETIRED) gentoo-dev 2010-06-07 13:37:39 UTC
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
Comment 2 David Abbott (RETIRED) gentoo-dev 2010-06-07 20:39:39 UTC
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
Comment 3 Peter Gantner (a.k.a. nephros) 2010-10-27 11:52:49 UTC
(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
Comment 4 Benny Pedersen 2013-05-31 01:12:55 UTC
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
Comment 5 Michael Orlitzky gentoo-dev 2016-06-04 15:40:55 UTC
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.