Hello there, I don't know for sure if this belongs here, but you you'll tell if not .
I'm using Ubuntu 14.04.2 LTS with Plesk version 12.0.18 Update #38. Spamassassin (spamd) 3.4.0 was installed already. System is up and running for 2 weeks now. The spamd is activated and configured in plesk. Options are "Switch on server-wide SpamAssassin spam filtering" and "Apply individual settings to spam filtering" so every user can do as he pleases. Rest is default. spamd stopps working after approx 48h. Here is what I did to get spamd working... (please read the whole text, some things I'll write are for your information, because I might have missed something)
spamd stopped working, so I had a look at the logfile (/opt/psa/var/log/maillog) and found this:
I logged on shell and tried to restart spamd (service spamassassin restart) as I always did. What I got was this:
spamd wasn't running that's why spamc couldn't find it. The PID of spamd was different from the one spamc was looking for. Let's have another look in the log after the restart.
The restart startet spamd and spawned two child processes, and spamc was happy. I had a look in the spamd.pid and the PID was 22182 but the log said 21622. In the spamd documentation I found this:
Sounds like my problem. BOOYAAHH, I solved it without whining in some forums . I added the option "--pidfile" to the config file in "/etc/default/spamassassin". It worked the first 24h. The next morning spamd was running and filtering and everything was fine. After the second 24h I got spam. Again. Hm, sh**. I thought I had it.
Another look in the log:
What is that?
I didn't send anything. But who does it? Something I haven't found out yet. A look at the config file in "/etc/default/spamassassin" revealed that it was altered. I added the option "--pidfile" again and had a look at the date. After 4 days spamd stopped working. So spamd runs for two days, then the config is altered and after another two days SIGTERM seems to kill the spamd process (I am not 100% about the timing, the altering could happen after 25h or 36h).
I tried to change the file properties of the config in "/etc/default/spamassassin" in read only, but to my surprise that didn't work.
So I (seem to) have a solution for my problem, but something keeps rewriting that config file after a certain time. Is there an option in plesk that I missed? A cron job I didn't see? HELP ME PLEASE! Great, I'm whining. Sorry.
Thx 4 F1.
st.
I'm using Ubuntu 14.04.2 LTS with Plesk version 12.0.18 Update #38. Spamassassin (spamd) 3.4.0 was installed already. System is up and running for 2 weeks now. The spamd is activated and configured in plesk. Options are "Switch on server-wide SpamAssassin spam filtering" and "Apply individual settings to spam filtering" so every user can do as he pleases. Rest is default. spamd stopps working after approx 48h. Here is what I did to get spamd working... (please read the whole text, some things I'll write are for your information, because I might have missed something)
spamd stopped working, so I had a look at the logfile (/opt/psa/var/log/maillog) and found this:
Mar 7 10:54:39 MYserverID spamc[19200]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
Mar 7 10:54:39 MYserverID spamc[19200]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
Mar 7 10:54:40 MYserverID spamc[19200]: connect to spamd on ::1 failed, retrying (#2 of 3): Connection refused
Mar 7 10:54:40 MYserverID spamc[19200]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
Mar 7 10:54:41 MYserverID spamc[19200]: connect to spamd on ::1 failed, retrying (#3 of 3): Connection refused
Mar 7 10:54:41 MYserverID spamc[19200]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
Mar 7 10:54:41 MYserverID spamc[19200]: connection attempt to spamd aborted after 3 retries
I logged on shell and tried to restart spamd (service spamassassin restart) as I always did. What I got was this:
SpamAssassin Mail Filter Daemon: No /usr/bin/perl found running; none killed
spamd wasn't running that's why spamc couldn't find it. The PID of spamd was different from the one spamc was looking for. Let's have another look in the log after the restart.
Mar 7 19:32:41 MYserverID spamd[21617]: logger: removing stderr method
Mar 7 19:32:42 MYserverID spamd[21622]: zoom: able to use 323/360 'body_0' compiled rules (89.722%)
Mar 7 19:32:43 MYserverID spamd[21622]: spamd: server started on IO::Socket::INET6 [127.0.0.1]:783, IO::Socket::INET6 [::1]:783 (running version 3.4.0)
Mar 7 19:32:43 MYserverID spamd[21622]: spamd: server pid: 21622
Mar 7 19:32:43 MYserverID spamd[21622]: spamd: server successfully spawned child process, pid 21623
Mar 7 19:32:43 MYserverID spamd[21622]: spamd: server successfully spawned child process, pid 21624
Mar 7 19:32:43 MYserverID spamd[21622]: prefork: child states: IS
Mar 7 19:32:43 MYserverID spamd[21622]: prefork: child states: II
The restart startet spamd and spawned two child processes, and spamc was happy. I had a look in the spamd.pid and the PID was 22182 but the log said 21622. In the spamd documentation I found this:
-r pidfile, --pidfile Write the process id to pidfile
Note: If spamd receives a SIGHUP, it internally reloads itself, which means that it will change its pid and might not restart at all if its environment changed (ie. if it can't change back into its own directory). If you plan to use SIGHUP, you should always start spamd with the -r switch to know its current pid.
Sounds like my problem. BOOYAAHH, I solved it without whining in some forums . I added the option "--pidfile" to the config file in "/etc/default/spamassassin". It worked the first 24h. The next morning spamd was running and filtering and everything was fine. After the second 24h I got spam. Again. Hm, sh**. I thought I had it.
Another look in the log:
spamd: server killed by SIGTERM, shutting down
What is that?
The kill(2) system call sends a specified signal to a specified process, if permissions allow. Similarly, the kill(1) command allows a user to send signals to processes.
I didn't send anything. But who does it? Something I haven't found out yet. A look at the config file in "/etc/default/spamassassin" revealed that it was altered. I added the option "--pidfile" again and had a look at the date. After 4 days spamd stopped working. So spamd runs for two days, then the config is altered and after another two days SIGTERM seems to kill the spamd process (I am not 100% about the timing, the altering could happen after 25h or 36h).
I tried to change the file properties of the config in "/etc/default/spamassassin" in read only, but to my surprise that didn't work.
So I (seem to) have a solution for my problem, but something keeps rewriting that config file after a certain time. Is there an option in plesk that I missed? A cron job I didn't see? HELP ME PLEASE! Great, I'm whining. Sorry.
Thx 4 F1.
st.