The default for amavisd is to write the pidfile in /var/lib/amavis/amavisd.pid, however /etc/init.d/amavisd specifies /var/run/amavis/amavisd.pid. The result is that systemd gets confused and thinks amavisd didn't start: # systemctl status amavisd amavisd.service - LSB: A Mail Virus Scanner Loaded: loaded (/etc/rc.d/init.d/amavisd) Active: failed (Result: timeout) since Tue, 2013-10-08 11:43:00 CEST; 1min 10s ago Process: 6248 ExecStart=/etc/rc.d/init.d/amavisd start (code=exited, status=0/SUCCESS) CGroup: name=systemd:/system/amavisd.service â 6257 /usr/sbin/amavisd (master) â 6263 /usr/sbin/amavisd (ch1-avail) â 6264 /usr/sbin/amavisd (ch1-avail) â 6265 /usr/sbin/amavisd (ch1-avail) â 6266 /usr/sbin/amavisd (ch1-avail) â 6267 /usr/sbin/amavisd (ch1-avail) worse, it cannot stop or restart it. To solve the problem I had to 1) edit /etc/init.d/amavisd to specify the correct pid file /var/lib/amavis/amavisd.pid [*] 2) systemctl stop amavisd 3) manually kill amavisd (since 3 cannot work) 4) systemctl --system daemon-reload 5) systemctl start amavisd After that systemctl shows the correct status: # systemctl status amavisd amavisd.service - LSB: A Mail Virus Scanner Loaded: loaded (/etc/rc.d/init.d/amavisd) Active: active (running) since Tue, 2013-10-08 11:45:08 CEST; 6min ago Process: 6579 ExecStart=/etc/rc.d/init.d/amavisd start (code=exited, status=0/SUCCESS) Main PID: 6588 (/usr/sbin/amavi) CGroup: name=systemd:/system/amavisd.service â 6588 /usr/sbin/amavisd (master) â 6596 /usr/sbin/amavisd (ch3-avail) â 6597 /usr/sbin/amavisd (ch3-avail) â 6598 /usr/sbin/amavisd (ch2-avail) â 6599 /usr/sbin/amavisd (ch2-avail) â 6600 /usr/sbin/amavisd (ch2-avail) [*] maybe now pid files should be under /var/run, but simply shipping an updated amavisd.conf wouldn't solve the problem for upgrades (like my case, where I just upgraded my mail server from mageia 2 to mageia 3). Reproducible: Steps to Reproduce:
The /var/run location is the correct one for PID files, so it should be patched to store its PID file in the location matching what's in the init script.
Hardware: x86_64 => AllAssignee: bugsquad => thomas
And actually if you're patching it anyway, even better to change both to say /run instead of /var/run
Why do we need a patch. It is already in /var/run/ I have no problem with amavisd in relation to the PID file. Neither for stopping nor for restart (or start). What takes up to 10 minutes is the command systemctl status amavisd to complete. But this isn't an amavisd problem, it's a problem with every program.
According to this report, it's not consistently using the same PID location specification everywhere. I haven't confirmed this myself. Certainly if systemctl status is taking 10 minutes, there's a problem, and it certainly does not affect everything (I haven't seen this behavior at all).
I just downloaded amavisd-new-2.8.0-14.mga3.noarch.rpm to check if I did a mistake, but it is exactly as I reported: amavisd, if not configured specifically, uses /var/lib/amavis/amavisd.pid, the supplied configuration doesn't override the default (and even if it did it wouldn't work for upgrades). The init file however specifies "pidfile: /var/run/amavis/amavisd.pid". This causes the symptoms I reported originally, I don't understand how it is possible that it works for you. Maybe it doesn't but you don't realize it: it takes forever to start because it doesn't find the pidfile and eventually it will timeout. For the same reason it will tell it has stopped it while it is still running.
You may need to update your /etc/amavisd/amavisd.conf you should have a line: $MYHOME = '/var/run/amavis'; # a convenient default for other settings, -H This should take care of the location of several tmp files
1) that's wrong, at least some of the files under $MYHOME are permanent, so they shouldn't be under /var/run (see http://www.pathname.com/fhs/2.2/fhs-5.13.html vs. http://www.pathname.com/fhs/2.2/fhs-5.8.html). There are other configuration parameters to fine tune individual directories without touching $MYHOME (e.g. there's one for the pidfile, named $pid_file). 2) even if it were right, the default configuration supplied with the package doesn't specify the correct directory for the pid file. 3) even if the package supplies a corrected configuration file, that wouldn't solve the problem for updates, that's why I proposed to change the pidfile in the init file (which would replace the existing one for update) 4) maybe the correct solution would be to patch amavis to conform to the fhs 5) even better would be to adopt the debian solution: patch amavisd to read a directory of configuration files instead of a single file, put there a default configuration with the correct settings, leaving users the option to override the settings in another file (though this approach too has problems for upgrades). See http://packages.debian.org/wheezy/amavisd-new
The bug has been introduced here http://svnweb.mageia.org/packages/cauldron/amavisd-new/current/SOURCES/amavisd-new-2.4.5-init.patch?r1=389214&r2=400941 i.e, it patches the init file without patching anything else.
See comment 2. The pid file needs to be in /run This make certain that it's being deleted when we reboot the box and we don't have a stale PID file as in the past and amavisd doesn't start. I am going to close this as invalid.
Status: NEW => RESOLVEDResolution: (none) => INVALID
My solution may be invalid, but the bug certainly stands. According to comment 2 both the init file and amavisd need to be patched so that both point to the same file. In fact, there's already a patch http://svnweb.mageia.org/packages/cauldron/amavisd-new/current/SOURCES/amavisd-new-mga_conf-2.diff?view=log that changes the default location of $MYHOME, it should be amended to also change $pid_file (in "sub supply_after_defaults") so that it points to /run/amavisd.pid. Or maybe just change the init file to supply the -P option to amavisd
Status: RESOLVED => REOPENEDResolution: INVALID => (none)
Hmm, one of my servers seemed to get stung by this on reboot today... Can't say I can work out what's going on here as the configs on a working server are near identical to one on a broken one. I guess the best fix is just to pass -P /run/amavis/amavis.pid on the command line in the initscript, that way it's specified absolutely? WDYT?
CC: (none) => mageia
Converted to native systemd unit in cauldron and mga3 updates testing. Will test this myself tomorrow once the package has bubbled through.
Colin, thanks for doing this. Have you been able to run some tests? If not, I think, I am going to upgrade my mga3 box with amavis from update-testing. I have a quite a lot of e-mails coming in from all the mailing lists.
Oh yeah, forgot to report back. Been using this for 1 week now and seems to be going strong: amavisd.service - AMAVIS interface between MTA and content checkers Loaded: loaded (/usr/lib/systemd/system/amavisd.service; enabled) Active: active (running) since Mon, 2013-11-04 23:37:42 GMT; 1 weeks and 0 days ago Process: 8070 ExecStart=/usr/sbin/amavisd -c /etc/amavisd/amavisd.conf -P /run/amavis/amavis.pid (code=exited, status=0/SUCCESS) Main PID: 8071 (/usr/sbin/amavi) CGroup: name=systemd:/system/amavisd.service â 8071 /usr/sbin/amavisd (master) â 28813 /usr/sbin/amavisd (ch9-avail) â 28954 /usr/sbin/amavisd (ch7-avail)
Is this ready to be tested and pushed as an update? Please assign to QA if so.
(In reply to David Walser from comment #15) > Is this ready to be tested and pushed as an update? Please assign to QA if > so. David: I only upgraded my server this morning. I haven't found a problem when enabling or starting it. But I would like to have it running for a least a full day. So be a little patient. This is a package we cannot afford it to fail.
I have been running this update for a day, processing some hunderts of e-mails. I don't see any regressions. The program starts and creates the tempdirs at the desired location. The package to be updated is amavisd-new-2.8.0 I am going to assign this to QA
CC: (none) => thomasAssignee: thomas => qa-bugs
Advisory 11407.adv committed to svn
CC: (none) => davidwhodginsWhiteboard: (none) => advisory
Testing complete on Mageia 3 i586 and x86_64. Someone from the sysadmin team please push 11407.adv to updates.
Keywords: (none) => validated_updateWhiteboard: advisory => advisory MGA3-64-OK MGA3-32-OKCC: (none) => sysadmin-bugs
Update pushed: http://advisories.mageia.org/MGAA-2013-0127.html
Status: REOPENED => RESOLVEDCC: (none) => tmbResolution: (none) => FIXED
Somebody forgot to remove the boilerplate text from the advisory "Advisory text to describe the update. Wrap lines at ~75 chars."
Boilerplate text removed. Thanks.
CC: (none) => boklm
(In reply to Nicolas Vigier from comment #22) > Boilerplate text removed. Thanks. Thanks. Sorry about that.
CC: boklm => (none)