Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
amavisd-new broken after update, permissions issue [SOLVED]
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21624

PostPosted: Wed Apr 06, 2022 5:02 pm    Post subject: Reply with quote

If the pid file exists, then the process started and wrote a pid file. The process may have died shortly thereafter and not cleaned out the pid file.
Back to top
View user's profile Send private message
MoonWalker
Guru
Guru


Joined: 04 Jul 2002
Posts: 510

PostPosted: Wed Apr 06, 2022 5:25 pm    Post subject: Reply with quote

Hu wrote:
If the pid file exists, then the process started and wrote a pid file. The process may have died shortly thereafter and not cleaned out the pid file.

Is there any way I can trace this actually is happening? I am doubtful, because wouldn't that mean /usr/sbin/amavisd would run and make a log entry?
_________________
/Joakim

Living on earth is expensive, but it includes a free trip around the sun
every year.
Back to top
View user's profile Send private message
papahuhn
l33t
l33t


Joined: 06 Sep 2004
Posts: 626

PostPosted: Thu Apr 07, 2022 9:55 am    Post subject: Reply with quote

@MoonWalker, I can reproduce your symptoms on a fresh "generic/gentoo" Vagrantbox. In mail.log I see

Quote:
Apr 7 09:52:34 gentoo amavis[14002]: (!)Net::Server: 2022/04/07-09:52:34 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.34/Net/Server/Proto/UNIX.pm


This helps:
Quote:
$MYHOME = '/var/lib/amavishome';

_________________
Death by snoo-snoo!
Back to top
View user's profile Send private message
MoonWalker
Guru
Guru


Joined: 04 Jul 2002
Posts: 510

PostPosted: Fri Apr 08, 2022 12:38 am    Post subject: Reply with quote

I already have
Quote:
$MYHOME = '/var/lib/amavishome';
in amavisd.conf, so that's not the problem, and yes the problem hasn't gone away.

Meanwhile, I have updated my system so it now uses profile 17.1, recompiled everything, but no change. amavisd simply doesn't start and it doesn't leave any clue in the logs, nothing! I am lost :(

Also, the bug I opened hasn't yielded anything. It was assigned but the assignee hasn't showed up... but hey, my issue is clearly not the same as the OP and the topic has also been marked as [SOLVED], so I will stop adding here and open my own thread instead.
_________________
/Joakim

Living on earth is expensive, but it includes a free trip around the sun
every year.
Back to top
View user's profile Send private message
MoonWalker
Guru
Guru


Joined: 04 Jul 2002
Posts: 510

PostPosted: Fri Apr 08, 2022 9:58 am    Post subject: Reply with quote

Actually, wont open a new topic as I found the cause of the issue and was able to solve it, sort of.

Not sure why I didn't come to think of this earlier, but eventually I got the idea to run /use/sbin/amavisd directly from the command line, which resulted in
Quote:
merc ~ # amavisd
Error in config file "/etc/amavisd.conf": Can't open PEM file /var/db/dkim/mydomain-com.key.pem: Permission denied at /usr/sbin/amavisd line 639.


so after commenting out
Quote:
#$enable_dkim_verification = 1; # enable DKIM signatures verification
#$enable_dkim_signing = 1; # load DKIM signing code, keys defined by dkim_key

#dkim_key('astrocalc.com', 'mydkim', '/var/db/dkim/mydomain-com.key.pem', k=>'rsa');


amavisd now starts and runs properly, and emails are delivered, although this is not a long term plausible solution.
_________________
/Joakim

Living on earth is expensive, but it includes a free trip around the sun
every year.
Back to top
View user's profile Send private message
papahuhn
l33t
l33t


Joined: 06 Sep 2004
Posts: 626

PostPosted: Fri Apr 08, 2022 10:38 am    Post subject: Reply with quote

Quote:
amavisd now starts and runs properly, and emails are delivered, although this is not a long term plausible solution.


The long term solution would be to make the pem file readable for amavis, I guess?
_________________
Death by snoo-snoo!
Back to top
View user's profile Send private message
papahuhn
l33t
l33t


Joined: 06 Sep 2004
Posts: 626

PostPosted: Fri Apr 08, 2022 10:48 am    Post subject: Reply with quote

Quote:
So from what I can understand, something external must have changed here related to this. Not quite sure what yet, but I will take it to the forums as I see now that this most likely isn't an amavisd bug.

Amavis changed.

Quote:
amavis-2.12.2 release notes

Resolve crash on reload with insufficient permissions. Amavis now tests whether it is able read and evaluate its configuration files with dropped privileges. In case it cannot, amavis fails to start and refuses to reload.


https://gitlab.com/amavis/amavis/-/issues/10
_________________
Death by snoo-snoo!
Back to top
View user's profile Send private message
MoonWalker
Guru
Guru


Joined: 04 Jul 2002
Posts: 510

PostPosted: Fri Apr 08, 2022 5:16 pm    Post subject: Reply with quote

papahuhn wrote:
Quote:
amavisd now starts and runs properly, and emails are delivered, although this is not a long term plausible solution.


The long term solution would be to make the pem file readable for amavis, I guess?

I suppose so, but I'm not up-to-date on this stuff as my dkim PEMs were created in 2009 and I don't even remember how I created them.
_________________
/Joakim

Living on earth is expensive, but it includes a free trip around the sun
every year.
Back to top
View user's profile Send private message
MoonWalker
Guru
Guru


Joined: 04 Jul 2002
Posts: 510

PostPosted: Fri Apr 08, 2022 5:24 pm    Post subject: Reply with quote

papahuhn wrote:
Quote:
So from what I can understand, something external must have changed here related to this. Not quite sure what yet, but I will take it to the forums as I see now that this most likely isn't an amavisd bug.

Amavis changed.

Quote:
amavis-2.12.2 release notes

Resolve crash on reload with insufficient permissions. Amavis now tests whether it is able read and evaluate its configuration files with dropped privileges. In case it cannot, amavis fails to start and refuses to reload.


https://gitlab.com/amavis/amavis/-/issues/10

Great dig up, thanks. I will take a look at that bug and see what I can learn. It's a bit odd though as I learned from grepping through the emerge.log, amavis didn't start to misbehave directly after I installed 2.12.2 but some days later, and right after I installed glibc-2.35-r2

Anyway, now I know what the issue is and the simple solution right now is probably to change ownership of those PEM files. However, as they are owned by root:root you don't just want to get on to that right away but do some investigation first.
_________________
/Joakim

Living on earth is expensive, but it includes a free trip around the sun
every year.
Back to top
View user's profile Send private message
freke
l33t
l33t


Joined: 23 Jan 2003
Posts: 977
Location: Somewhere in Denmark

PostPosted: Sat Apr 09, 2022 8:35 am    Post subject: Reply with quote

MoonWalker wrote:
papahuhn wrote:
Quote:
So from what I can understand, something external must have changed here related to this. Not quite sure what yet, but I will take it to the forums as I see now that this most likely isn't an amavisd bug.

Amavis changed.

Quote:
amavis-2.12.2 release notes

Resolve crash on reload with insufficient permissions. Amavis now tests whether it is able read and evaluate its configuration files with dropped privileges. In case it cannot, amavis fails to start and refuses to reload.


https://gitlab.com/amavis/amavis/-/issues/10

Great dig up, thanks. I will take a look at that bug and see what I can learn. It's a bit odd though as I learned from grepping through the emerge.log, amavis didn't start to misbehave directly after I installed 2.12.2 but some days later, and right after I installed glibc-2.35-r2

Anyway, now I know what the issue is and the simple solution right now is probably to change ownership of those PEM files. However, as they are owned by root:root you don't just want to get on to that right away but do some investigation first.


I would expect that root:amavis (and a 640 permission) for the PEMs should work.
Back to top
View user's profile Send private message
MoonWalker
Guru
Guru


Joined: 04 Jul 2002
Posts: 510

PostPosted: Sat Apr 09, 2022 11:27 am    Post subject: Reply with quote

freke wrote:
I would expect that root:amavis (and a 640 permission) for the PEMs should work.


Yes, that's what I ended up with as I don't think they are used by anyone else. It would be postfix and/or dovecot in such case but hasn't noticed anything so far.
_________________
/Joakim

Living on earth is expensive, but it includes a free trip around the sun
every year.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum