I'm starting to have this problem, when I try to start spamassassin (/etc/init.d/spamd start), I get: Could not create INET socket: Invalid argument IO::Socket::INET: Invalid argument The version of spamassassin is 2.63
Please post the output of the following five commands: cat /etc/conf.d/spamd spamd -D emerge -pv spamassassin perl -V id
<b>cat /etc/conf.d/spamd</b> SPAMD_OPTS="-a" <b>spamd -D</b> debug: Score set 0 chosen. Could not create INET socket: Invalid argument IO::Socket::INET: Invalid argument <b>emerge -pv spamassassin</b> [ebuild R ] mail-filter/spamassassin-2.63 +berkdb +ssl 0 kB <b>id</b> uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video),250(portage) (let's hope the b tags stick up) ;)
Created attachment 36138 [details] perl -V
Created attachment 36150 [details, diff] (Test) patch against spamd That looks like a local configuration problem. From <http://ftp.cfu.net/pub/amavisd-new/>: | On some operating systems the Perl module IO::Socket reports obscure error | on unsuccessful connect() in non-blocking mode as: "Invalid argument" in | place of the true cause: "Connection refused". The remote service should be | checked if available and accessible (firewall rules? network problems?). | | Another possible reason for "Invalid argument" reported by IO::Socket when | running within chroot jail is some network-related system file missing in a | chroot jail, e.g. /etc/protocols, /etc/services, /etc/netconfig, | /etc/resolv.conf, /etc/nsswitch.conf, /etc/hosts, /etc/host.conf | -- depending on the operating system in use. System debugging tools | (debugger, strace, truss) may help to find the cause. Please do the following: 1. What does the following command say? Should be 1.27. perl -MIO::Socket -le 'print $IO::Socket::INET::VERSION' 2. Please apply the attached patch with the following command (replace "spamd.patch" with the name under which you saved the attachment): patch /usr/bin/spamd spamd.patch You should get the following: creating INET socket: Listen: 128 LocalAddr: 127.0.0.1 LocalPort: 783 Proto: 6 ReuseAddr: 1 Type: 1 If you've got different values, something's wrong with your system but I can hopefully find out what it is ;)
yes it is 1.27, and the patch gives me: debug: Score set 0 chosen. creating INET socket: Listen: 128 LocalAddr: 127.0.0.1 LocalPort: 783 Proto: 6 ReuseAddr: 1 Type: 1 Could not create INET socket: Invalid argument IO::Socket::INET: Invalid argument
Hm, the last few days I learned more about the IO::Socket internals than I ever wanted ;-) This looks like some Perl bug, nothing really SpamAssassin related. Either the call socket(AF_INET, SOCK_STREAM, 6) or sockopt(SO_REUSEPORT, 1) fails with an EINVAL. Which shouldn't happen. Just out of interested, could you please attach the output of 'strace spamd' so I know which command exactly fails? As a workaround, you could try to use spamd with UNIX sockets (which is also a little bit faster than TCP). See --socketpath in the spamd manpage and -U for spamc. Maybe re-emerging perl would help, too, but I doubt it.
read(5, "# /etc/protocols:\n# $Id: protoco"..., 4096) = 1846 close(5) = 0 munmap(0x40018000, 4096) = 0 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 5 ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffff78c) = -1 EINVAL (Invalid argument) _llseek(5, 0, 0xbffff7c0, SEEK_CUR) = -1 ESPIPE (Illegal seek) ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffff78c) = -1 EINVAL (Invalid argument) _llseek(5, 0, 0xbffff7c0, SEEK_CUR) = -1 ESPIPE (Illegal seek) fcntl64(5, F_SETFD, FD_CLOEXEC) = 0 setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 bind(5, {sa_family=0x3837 /* AF_??? */, sa_data="3\0\0\0\0\0\0\0\0\0001\306\1\0"}, 3) = -1 EINVAL (Invalid argument) close(5) = 0 write(2, "Could not create INET socket: In"..., 82Could not create INET socket: Invalid argument IO::Socket::INET: Invalid argument
bind(5, {sa_family=0x3837 /* AF_??? */, sa_data="3\0\0\0\0\0\0\0\0\0001\306\1\0"}, 3) = -1 EINVAL (Invalid argument) This looks fishy and is the culprit. sa_family should be AF_INET, which is 2. And addrlen (the third parameter) should be 16 instead of 3. That command is called in the deep guts of Perl itself, your 'perl -V' output looks good, I don't know why your Perl is so b0rked.
updating perl to the latest table on the stable tree did the trick (5.8.4)
Great. Thanks for helping debugging this stuff.
I seem to be getting this also now after emerging dev-lang/perl-5.8.5-r2, has any of your done an upgrade to this version yet with spamassassin?