On Fri, Jan 23, 2009 at 03:34:37PM +0400, root wrote:
> Initrc script for spamd uses start-stop-daemon with --exec option both for
> starting and stopping. This option makes start-stop-daemon check the 
> /proc/PID/exe value. On my system spamd process have /proc/pid/exe pointing
> to /usr/bin/perl, not to /usr/sbin/spamd, so spamd starts ok, but refuses to
> stop saying a message: "No /usr/sbin/spamd found running; none killed."
> Since spamd uses pid file, I think it will be trivial to remove --exec
> parameter from "stop" and "reload" commands in /etc/init.d/spamassassin.
> ("restart" already have no --exec option with --stop command)

Hello,

I'm not sure your diagnosis is correct.  I am not able to reproduce the
bug as you describe it.  Spamd is properly terminated with the existing
spamassassin init script.  However, while investigating this, I have
found an alternate possibility.  spamd doesn't write its pid file until
after it has initialized, which takes some time.  The following log
entries show that, on my system, a full 13 seconds elapse between the
first two messages logged to syslog when spamd starts:

Feb 18 22:35:40 insomnia spamd[29203]: logger: removing stderr method
Feb 18 22:35:53 insomnia spamd[29205]: spamd: server started on port 783/tcp 
(running version 3.2.5)
Feb 18 22:35:53 insomnia spamd[29205]: spamd: server pid: 29205
Feb 18 22:35:53 insomnia spamd[29205]: spamd: server successfully spawned child 
process, pid 29213
Feb 18 22:35:53 insomnia spamd[29205]: spamd: server successfully spawned child 
process, pid 29214
Feb 18 22:35:53 insomnia spamd[29205]: prefork: child states: II

So in this case, between 22:35:40 and 22:35:53 spamd is running, but has
not yet written its pid file.  If I run "/etc/init.d/spamassassin stop"
during this time, it fails with the symptom that you described in your
report.  After 22:35:53, the pid file exists and
/etc/init.d/spamassassin can correctly terminate spamd.

Is it possible that the behavior you're describing is explained this
way?

noah


Attachment: signature.asc
Description: Digital signature

Reply via email to