# amavisd-release test Can't connect to UNIX socket /var/amavis/amavisd.sock: No such file or directory at /usr/sbin/amavisd-release line 272. It works after changing the socketname in /usr/sbin/amavisd-release: -$socketname = '/var/amavis/amavisd.sock'; +$socketname = '/var/lib/amavishome/amavisd.sock';
mail-filter/amavisd-new-2.12.0-r4::gentoo was built with the following: USE="clamav dkim razor spamassassin -courier -ldap -mysql -postgres -qmail -rspamd -rspamd-https -snmp -zmq" ABI_X86="(64)"
This is in /etc/amavisd.conf: $unix_socketname = "$MYHOME/amavisd.sock"; # amavisd-release or amavis-milter
The socket is, unfortunately, independently configurable via /etc/amavisd.conf and amavisd-release. Both settings need to match, but that is for the user to ensure. Also, the user can opt for TCP sockets or Unix Domain sockets, so picking one at random is problematic. Short version: It is a problem which we have upstream. Michael filed a related issue, by the way: https://gitlab.com/amavis/amavis/-/issues/58 . You may want to consider adding your remarks there.
Tomáš, I am still not sure if there is a way to fix this for Gentoo. Creating a new ebuild version which changes the socket definition in amavisd-release, as you suggested, would break existing installations. Unless you have a better suggestion, I am inclined to close this issue.
Just tried installing a vanilla amavisd-new on my testing machine. When amavisd is started this is printed: Oct 14 08:47:04 amavis[20992]: (!)Net::Server: 2020/10/14-08:47:04 Couldn't open pid file "/var/amavis/amavisd.pid" [No such file or directory].\n\n at line 177 in file /usr/lib64/perl5/vendor_perl/5.30.3/Net/Server.pm So I believe new users will set: < # $MYHOME = '/var/amavis'; # a convenient default for other settings, -H --- > $MYHOME = '/var/lib/amavishome'; # a convenient default for other settings, -H And then amavisd starts correctly. Is that correct?
(In reply to Tomáš Mózes from comment #5) > Oct 14 08:47:04 amavis[20992]: (!)Net::Server: 2020/10/14-08:47:04 Couldn't > open pid file "/var/amavis/amavisd.pid" [No such file or directory].\n\n at > line 177 in file /usr/lib64/perl5/vendor_perl/5.30.3/Net/Server.pm That's not what I see. How exactly did you start amavis? The supported method is using the /etc/init.d/amavisd OpenRC script. This script will launch amavis as a foreground process and delegate PID file handling to start-stop-daemon.
(In reply to Ralph Seichter from comment #6) > (In reply to Tomáš Mózes from comment #5) > > > Oct 14 08:47:04 amavis[20992]: (!)Net::Server: 2020/10/14-08:47:04 Couldn't > > open pid file "/var/amavis/amavisd.pid" [No such file or directory].\n\n at > > line 177 in file /usr/lib64/perl5/vendor_perl/5.30.3/Net/Server.pm > That's not what I see. How exactly did you start amavis? The supported > method is using the /etc/init.d/amavisd OpenRC script. This script will > launch amavis as a foreground process and delegate PID file handling to > start-stop-daemon. My bad, sorry, started amavisd directly, because some modules were missing and running via openrc failed, so I wanted to see why it fails to run. So once again, now I have a working testing scenario, all I did was to change $myhostname in /etc/amavisd.conf, but starting via /etc/init.d/amavisd fails: ==> mail.log <== Oct 16 11:48:33 amavis[6711]: (!)Net::Server: 2020/10/16-11:48:33 Can't connect to UNIX socket at file /var/amavis/amavisd.sock [No such file or directory]\n at line 66 in file /usr/lib64/perl5/vendor_perl/5.30.3/Net/Server/Proto/UNIX.pm Seems like it's because by default: $unix_socketname = "$MYHOME/amavisd.sock" And $MYHOME defaults to /var/amavis.
Closing this issue WRT the existing upstream issue (see comment #3).