PDA

View Full Version : OpenBSD's SPAMd dying


stukov
06-05-2008, 03:05 PM
Hello,

I have a FreeBSD machine running OpenBSD's SPAMd and SPAMd crashes sometimes... "/usr/local/etc/rc.d/obspamd status" show the process is not running and there is only a gap in my logs... nothing about the failure. Restarting the service works.

Any ideas?

richardpl
06-06-2008, 03:49 AM
Well try to get crash dump of crashed process (if it crashed at all) and debug it. Find way to 100% reproduce problem.

Current report is very obscure.

obspamd appears to be shell script (it is listed in files directory of FreeBSD SPAMd port)

stukov
06-06-2008, 06:04 PM
Thanks for the reply richardpl,

Yes, the problem is also very obscure to me. What makes me guess it's a crash is the absence of anything useful in my log file. I simply have a "gap" between the time the process died and when I restarted it manually:Jun 6 05:06:25 spamd[96152]: 88.254.50.84: connected (3/1)
Jun 6 07:02:58 spamd[53857]: listening for incoming connections.

Currently, I am more suspecting another application is sending something like "killall spamd" to the system (to kill and restart, I think, Spam Assassin).

Would there be any ways of "intercepting" or logging those kill signals?

Thanks!

ohauer
06-07-2008, 11:16 AM
Currently, I am more suspecting another application is sending something like "killall spamd" to the system (to kill and restart, I think, Spam Assassin).


This can be possible, to make shure it is this problem try the patch.
http://sorry.mine.nu/patches/FreeBSD/ports/spamd/.individual/patch-spamd-for-stukov.diff
short howto apply the patch:

cd /usr/ports/mail
patch < path_to_patch/patch-spamd-for-stukov

I never had this problems at any of my machines, but i don't run SpamAssassin's spamd.

Please give report so others can also benefit in next versions of spamd, even you solved the problem at another way.

Thanks

stukov
06-09-2008, 04:02 PM
Thanks for the patch ohauer. I will have to do this by night. I'll let you know guys how it went.

ohauer
06-09-2008, 08:41 PM
Please note the patch change only the binary name to obspamd and adjusts the name in the rc script and for the pitfile.
If the problem persists we have to search for the reason in the ported spamd.
If the problem is gone we have to search if something send a signal to the wrong deamon.
I hope the second one ;)

stukov
06-15-2008, 06:31 PM
OK. Dumb question. How do I overcome to following error?
# cvsup /root/ports-supfile
# cd /usr/ports/mail
# patch < /tmp/spamd-patch
# cd spamd
# make
===> Extracting for spamd-4.1.2
=> MD5 Checksum OK for spamd-4.1.2.tar.gz.
=> SHA256 Checksum OK for spamd-4.1.2.tar.gz.
===> Patching for spamd-4.1.2
===> Applying FreeBSD patches for spamd-4.1.2
1 out of 1 hunks failed--saving rejects to spamd/Makefile.rej
=> Patch patch-spamd:Makefile failed to apply cleanly.
=> Patch(es) patch-makefile applied cleanly.
*** Error code 1

Stop in /usr/ports/mail/spamd.

ohauer
06-15-2008, 07:13 PM
Hm,

maybe there is some leftover.
I made a clean port for you, please grap it here:
http://sorry.mine.nu/patches/FreeBSD/ports/spamd/.individual/spamd-stukov.tar.gz

extract the port with the following command
# tar xvfz spamd-stukov.tar.gz -C /usr/ports/mail/
then
# cd /usr/ports/mail/spamd-stukov/
# make

If you have problems send me a PR

stukov
06-15-2008, 07:21 PM
Thanks ohauer. New port in place. Let's hope the process will survive tomorrow. I'll let you know if that worked out as expected.

Thanks!

stukov
06-16-2008, 02:51 PM
ohauer, that did the trick. I could sleep late this morning because there were no Nagios alarms to wake me up :)

I suppose this was, in fact, a killall sent by some cPanel script for SpamAssassin.

Thanks again!

ohauer
06-16-2008, 04:16 PM
I could sleep late this morning because there were no Nagios alarms to wake me up
Thats one of the reason why people choose *BSD :)

I'm a little afread that this happens again if you update the mail/spamd port.

I have taken a short look into the community from cPanel and notice that some of them adjust there scripts from `pkill -HUP $procname` to 'kill -HUP `cat /var/run/xxx.pid`'

Can you do a grep -R spamd over the cPanel scripts?
Maybe they can adjust the kill command in the next release to the pidfile?

At the moment there are two pid files
/var/run/spamd/spamd.pid => SpamAssassin spamd
/var/run/spamd.pid => OpenBSD spamd (in your case with patch now obspamd.pid)

Reasons to not change the default deamon name to obspamd for me
- keep code and names from OpenBSD so people know it comes from there
- break of existing scripts for the mail/spamd port since procname change, for example logfile parsers, statistics ...
- bad feedback for the change from pf-spamd to obspamd (that's another story)

stukov
06-16-2008, 04:18 PM
Thanks ohauer. I will open a bug report with cPanel and strongly recommend that this issues gets fixed for the other releases.

Thank you very much for you help, your patches and your helpful explanations.