Bug 696725

Summary: RPM doesn't create /var/run/amavisd
Product: [Fedora] Fedora Reporter: Trever Adams <trever>
Component: amavisd-newAssignee: Steven Pritchard <steve>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: fedora.jrg01, james.hill, matthias_haase, paul, perl-devel, raina, roger, steve, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: amavisd-new-2.6.6-1.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-02 18:15:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
tmpfile.d file none

Description Trever Adams 2011-04-14 18:00:18 UTC
Description of problem:
The RPM doesn't create /var/run/amavisd, the amvaisd.pid file gets created here at runtime. This directory needs to be created with g+w permissions with group amavis for this package to work correctly.

Version-Release number of selected component (if applicable):
amavisd-new-2.6.4-3.fc15.noarch

Comment 1 Trever Adams 2011-04-16 18:04:43 UTC
It appears that every time amavis shuts down, it erases /var/run/amavisd.

I do not know what the proper solution is, but for now I am editing /etc/rc.d/init.d/amavisd, placing the following right after RETVAL=0
mkdir /var/run/amavisd
chgrp amavis /var/run/amavisd
chmod g+w /var/run/amavisd

Comment 2 Paul Howarth 2011-04-18 08:48:54 UTC
In Fedora 15, /var/run and /var/lock are tmpfs filesystems and hence are cleared at every reboot. All packages that maintain files/directories within those directories need to take this into account. Creating them in the initscript is one option, and dropping a file into /etc/tmpfiles.d to get systemd to do it would be another.

See: http://fedoraproject.org/wiki/Features/var-run-tmpfs

Comment 3 Trever Adams 2011-04-18 13:01:27 UTC
Is there anyway to get a proper fix in the RPM package?

Comment 4 Trever Adams 2011-05-27 18:06:34 UTC
Created attachment 501354 [details]
tmpfile.d file

The fix seems to be to place this in /etc/tmpfile.d from the RPM. Is it possible to get this added so that things work properly out of the box? Thank you.

Comment 5 John Griffiths 2011-06-06 05:05:42 UTC
amavisd-new, clamd.amavid, and postfix is a common email configuration. Not sure how something like this would slip through pre-release test.

Comment 6 Trever Adams 2011-06-06 05:58:09 UTC
I never did check clamd.amavisd. It may need a similar fix (although it works without it, just as dspam largely did).

Comment 7 Matthias Haase 2011-06-10 07:49:03 UTC
(In reply to comment #4)
> Created attachment 501354 [details]
> tmpfile.d file
> 
> The fix seems to be to place this in /etc/tmpfile.d from the RPM. Is it
> possible to get this added so that things work properly out of the box? Thank
> you.

I have this file added and that doesn't work. No creation of the missed directory in /var/run
even at boot or using start|stop of amavisd. May be this is  a timimg issue, I couldn't find out why.

The only working solution at present is creating the missed directory inside of the start|stop script, as Trever wrote already.

Comment 8 Paul Howarth 2011-06-10 07:59:26 UTC
It's "/etc/tmpfiles.d", not "/etc/tmpfile.d"; the conf files from there are processed by systemd at boot time. The package should also include the required directories itself so that they are created at package install time so that the package can work immediately after installation without requiring a reboot.

Comment 9 Matthias Haase 2011-06-10 09:16:18 UTC
Sorry, was  typo, of course I have placed the file at the right directory, there are several similiar files, for example httpd.conf. That doesn't work for amavisd.

Comment 10 Matthias Haase 2011-06-10 09:26:07 UTC
Sorry, was  typo, of course I have placed the file at the right directory, there are several similiar files, for example httpd.conf. That doesn't work for amavisd.

Comment 11 Paul Howarth 2011-06-10 10:01:34 UTC
The attachment from Comment #4 doesn't line up with the permissions/ownership in the spec file for amavisd-new, and that's why it's not working. Try using this line instead:

d /var/run/amavisd 0755 amavis amavis -

This works for me.

Comment 12 Matthias Haase 2011-06-10 10:27:52 UTC
Confirmed. Right ownership for user and group now. I'll remove now the - liitle bit - ugly code from start stop script.

Comment 13 Trever Adams 2011-06-10 13:05:13 UTC
Sorry, I thought I had the right permissions. Thank you for fixing it.

Comment 14 Johan Kok 2011-06-11 18:15:28 UTC
*** Bug 704769 has been marked as a duplicate of this bug. ***

Comment 15 James Hill 2011-08-27 12:49:49 UTC
Still not fixed in the repositories yet.

Comment 16 Fedora Update System 2011-09-19 02:40:19 UTC
amavisd-new-2.6.6-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/amavisd-new-2.6.6-1.fc15

Comment 17 Fedora Update System 2011-09-19 02:41:12 UTC
amavisd-new-2.6.6-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/amavisd-new-2.6.6-1.fc16

Comment 18 Fedora Update System 2011-09-19 18:32:14 UTC
Package amavisd-new-2.6.6-1.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing amavisd-new-2.6.6-1.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/amavisd-new-2.6.6-1.fc16
then log in and leave karma (feedback).

Comment 19 Fedora Update System 2011-10-02 18:15:18 UTC
amavisd-new-2.6.6-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 20 Fedora Update System 2011-10-02 23:06:34 UTC
amavisd-new-2.6.6-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.