Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Updated Spamassassin this morning to 3.4 from 3.2 using CPAN, as I normally have done in the past and since them, getting maillog entries as follows:
Any ideas?
running on Slack14 64
Never had anything like this on 3.2
Thanks in advance...
Code:
May 3 12:09:01 orion spamc[14088]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
May 3 12:09:02 orion spamc[14088]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
May 3 12:09:03 orion spamc[14088]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
May 3 12:09:06 orion spamc[14105]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
May 3 12:09:07 orion spamc[14105]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
May 3 12:09:08 orion spamc[14105]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
May 3 12:09:10 orion spamc[14117]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
May 3 12:09:11 orion spamc[14117]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
May 3 12:09:12 orion spamc[14117]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
May 3 12:09:14 orion spamc[14129]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
May 3 12:09:15 orion spamc[14129]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
May 3 12:09:16 orion spamc[14129]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
May 3 12:09:41 orion spamc[14285]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
May 3 12:09:42 orion spamc[14285]: connect to spamd on 127.0.0.1 failed, retrying (#2 of 3): Connection refused
May 3 12:09:43 orion spamc[14285]: connect to spamd on 127.0.0.1 failed, retrying (#3 of 3): Connection refused
May 3 12:11:53 orion spamc[14578]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:53 orion spamc[14580]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:53 orion spamc[14582]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:53 orion spamc[14584]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:53 orion spamc[14586]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:53 orion spamc[14588]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:53 orion spamc[14590]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:53 orion spamc[14592]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:58 orion spamc[14616]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:58 orion spamc[14618]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:58 orion spamc[14620]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:58 orion spamc[14622]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:58 orion spamc[14624]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:58 orion spamc[14626]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:58 orion spamc[14628]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:11:58 orion spamc[14630]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:15:38 orion spamc[15238]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:25:11 orion spamc[15275]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:31:56 orion spamc[15301]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 12:40:49 orion spamc[15326]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 13:02:54 orion spamc[15399]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 13:03:22 orion spamc[15418]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 13:04:31 orion spamc[15427]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 13:10:31 orion spamc[15452]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 13:12:05 orion spamc[15466]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 13:24:48 orion spamc[15536]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
spamd is a daemon (you're running spamassassin daemonized) and changing its environment or the system wide config files normally requires restarting spamd or forsing it to reload itself via sighup. Although reload will change the pid so reload it with the -r switch to be aware of its current pid. Most probably your spamd restarted after you had upgraded it therefore the pid changed and it won't start now. Try to look and dig through this direction.
I am able to stop and start things, the extract from the maillog is as follows for a shutdown and startup of the spamd:
Code:
May 3 15:42:16 orion spamd[16928]: spamd: server killed by SIGTERM, shutting down
May 3 15:42:19 orion sm-mta[16948]: starting daemon (8.14.5): SMTP+queueing@00:25:00
May 3 15:42:19 orion sm-msp-queue[16951]: starting daemon (8.14.5): queueing@00:25:00
May 3 15:42:19 orion spamd[16952]: logger: removing stderr method
May 3 15:42:25 orion spamd[16955]: spamd: server started on IO::Socket::INET [127.0.0.1]:783 (running version 3.4.0)
May 3 15:42:25 orion spamd[16955]: spamd: server pid: 16955
May 3 15:42:25 orion spamd[16955]: spamd: server successfully spawned child process, pid 16956
May 3 15:42:25 orion spamd[16955]: spamd: server successfully spawned child process, pid 16957
May 3 15:42:25 orion spamd[16955]: prefork: child states: IS
May 3 15:42:25 orion spamd[16955]: prefork: child states: II
sorry, perhaps not properly exmplaining myself, it is running but the logs are now showing
connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
whenever it's called.
Generally followed up by
spamd: connection from localhost [127.0.0.1]:48393 to port 783, fd 5
Looks like a problem with the localhost ipv6 address. Use
You can disable ipv6 (by blacklisting the ipv6 module) if you don't need it, so spamc uses only 127.0.0.1.
Or else create /etc/mail/spamassassin/spamc.conf and add in it:
ok, so I created the file /etc/mail/spamassassin/spamc.conf
containing only:
-d 127.0.0.1
restarted the spamd and the maillog shows:
Code:
May 3 18:59:31 orion spamd[17308]: spamd: server killed by SIGTERM, shutting down
May 3 18:59:34 orion sm-mta[17799]: starting daemon (8.14.5): SMTP+queueing@00:25:00
May 3 18:59:34 orion sm-msp-queue[17802]: starting daemon (8.14.5): queueing@00:25:00
May 3 18:59:34 orion spamd[17803]: logger: removing stderr method
May 3 18:59:40 orion spamd[17806]: spamd: server started on IO::Socket::INET [127.0.0.1]:783 (running version 3.4.0)
May 3 18:59:40 orion spamd[17806]: spamd: server pid: 17806
May 3 18:59:40 orion spamd[17806]: spamd: server successfully spawned child process, pid 17807
May 3 18:59:40 orion spamd[17806]: spamd: server successfully spawned child process, pid 17808
May 3 18:59:40 orion spamd[17806]: prefork: child states: IS
May 3 18:59:40 orion spamd[17806]: prefork: child states: II
and sent a few mails to see what shows in the logs and...
Code:
May 3 19:02:53 orion spamd[17807]: spamd: connection from localhost [127.0.0.1]:48433 to port 783, fd 5
REMOVED THE NEW spamc.conf FILE JUST TO BE 100% AND...
Code:
May 3 19:07:35 orion spamc[17863]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
May 3 19:07:35 orion spamd[17857]: spamd: connection from localhost [127.0.0.1]:48435 to port 783, fd 5
So all in all, solved.
thanks a lot, tell you what though, this for sure didn't happen with spamassassin 3.2 only after updating to 3.4
Good point of note though, starting with
Code:
/usr/local/bin/spamd -c -d -4
DID NOT ITSELF WORK BUT creating the file /etc/mail/spamassassin/spamc.conf
containing only:
The thing is that I ran into the same issue as well. I notice it happens after certain automatic updates are installed. This is weird but this is another story how to stop it happening.
The solution I had is to insert this into /etc/default/spamassassin
Well, it's not exactly my solution, I simply had it configured in the first place when setting up my spamd so will have to run a few tests to see if it helps. It has been working fine for a year or so though.
My problem now is advanced. I see the logs only after my crons.daily is run. It triggers this error only once and then almost instantly gets back to normal.
Code:
spamc[14088]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
Then I have it working perfectly fine till the time comes for my daily cron to run...
The /.spamassassin/user_prefs file has to be owned by root:root.
It did the trick and the
Code:
spamc[14088]: connect to spamd on 127.0.0.1 failed, retrying (#1 of 3): Connection refused
disappeared by itself.
Plus, the following solved my other issue with the /.spamassassin/user_prefs being permission denied. I added this to /spamassassin/local.cf
Code:
allow_user_rules 1
This is also made sure that "connection refused" and "permission denied" are gone.
However, the following security notice should be taken into consideration when allow_users_rules is applied,
quote, "Note: if you use spamd, rules placed in user_prefs will be IGNORED by default. If you add the allow_user_rules option to your local.cf you can get spamd to honor them. However, before you enable it, you should know that this is disabled by default for security reasons. In theory a malicious local user might be able to exploit spamd with a clever regex and gain root permissions. I know of no specific vulnerabilities of this type in spamassassin at this time, but it is a possibility. I'd only turn this on if you trust your local users not to try to hack root." unquote
Hope it will help someone else as well.
Last edited by Klaipedaville; 09-06-2014 at 05:42 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.