Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 745954 - mail-filter/amavisd-new: adjust socket for amavisd-release
Summary: mail-filter/amavisd-new: adjust socket for amavisd-release
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ralph Seichter
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-01 09:30 UTC by Tomáš Mózes
Modified: 2020-11-15 23:52 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomáš Mózes 2020-10-01 09:30:25 UTC
# 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';
Comment 1 Tomáš Mózes 2020-10-01 09:31:25 UTC
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)"
Comment 2 Tomáš Mózes 2020-10-01 09:32:45 UTC
This is in /etc/amavisd.conf:
$unix_socketname = "$MYHOME/amavisd.sock";  # amavisd-release or amavis-milter
Comment 3 Ralph Seichter 2020-10-01 13:51:25 UTC
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.
Comment 4 Ralph Seichter 2020-10-13 20:55:48 UTC
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.
Comment 5 Tomáš Mózes 2020-10-14 08:50:51 UTC
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?
Comment 6 Ralph Seichter 2020-10-14 17:03:23 UTC
(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.
Comment 7 Tomáš Mózes 2020-10-16 11:50:42 UTC
(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.
Comment 8 Ralph Seichter 2020-11-15 23:52:13 UTC
Closing this issue WRT the existing upstream issue (see comment #3).