|
Bugzilla – Full Text Bug Listing |
| Summary: | amavis failed to start during boot, however it is active | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE 12.1 | Reporter: | Freek de Kruijf <freek> |
| Component: | Other | Assignee: | Peter Varkoly <varkoly> |
| Status: | RESOLVED DUPLICATE | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P2 - High | CC: | forgotten__lyEjnLCxo, lnussel, melchiaros, roland, suse-beta, werner |
| Version: | RC 2 | ||
| Target Milestone: | --- | ||
| Hardware: | x86-64 | ||
| OS: | SUSE Other | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: |
Patch for /etc/init.d/amavis
modified /etc/init.d/amavis to work around checkproc |
||
|
Description
Freek de Kruijf
2011-07-16 16:26:10 UTC
This is still a bug in openSUSE 12.1 M5 and has not changed *** Bug 711006 has been marked as a duplicate of this bug. *** I compared the file /etc/init.d/amavis between 11.4 and 12.1 and they are the same. However the program /usr/sbin/amavisd is different in these versions. I contacted the maintainer of the amavis project to point him to this problem. I also tried the command "/usr/sbin/amavisd stop" which did stop the amavisd processes in my system. This also seems to be the command given in "/etc/init.d/amavis stop", which does not work. Analysing the problem I found that the behavior of checkproc is causing the problem. While amavisd is active, with three processes, 1 master and 2 childs), the command "checkproc amavisd ; echo $?" gives on openSUSE 11.4 the result 0 openSUSE 12.1 the result 3 The command "checkproc /usr/sbin/amavisd ; echo $?" gives on openSUSE 11.4 the result 3 openSUSE 12.1 the result 3 Reading the manual pages of checkproc I conclude that checkproc on openSUSE 11.4 gives the wrong answer. This means that the file /etc/init.d/amavis on openSUSE 12.1 is wrong. The return codes of "checkproc amavis" in the script are inverted. Because the manpage of checkproc always talks about the full patch of the executable I made the attached patch for /etc/init.d/amavis It is more complicated than I thought, so it will take a while for the patch. Created attachment 451548 [details]
Patch for /etc/init.d/amavis
I did test the new script for start, stop and status, however not with amavis_milter and not for the other commands.
CC'ing Werner Fink, the maintainer of sysvinit (which includes checkproc). Werner, please see comment #4 about the changed (broken?) behaviour of checkproc. Rereading the manpage of checkproc I found that replacing amavisd by $AMAVISD_BIN as the argument of checkproc is not right. The file /usr/sbin/amavisd is a perl script and in that case IMHO the proper way is to use amavisd.
I also read that the return code should be 0 when that process is active. However that is not the case.
Below is the console log as root in my 12.1 M5 system with the above changes in the /etc/init.d/amavis file.
eik121m5:~ # rcamavis status
Checking for service amavis (amavisd-new): unused
eik121m5:~ # ps aux | grep amavis
root 2436 0.0 0.0 6780 856 pts/1 S+ 17:27 0:00 grep amavis
eik121m5:~ # rcamavis start
Starting virus-scanner (amavisd-new): done
eik121m5:~ # ps aux | grep amavis
vscan 2497 15.1 10.2 222172 104240 ? Ss 17:28 0:01 amavisd (master)
vscan 2500 0.0 10.1 223444 103264 ? S 17:28 0:00 amavisd (virgin child)
vscan 2501 0.0 10.1 223444 103260 ? S 17:28 0:00 amavisd (virgin child)
root 2507 0.0 0.0 6780 860 pts/1 S+ 17:28 0:00 grep amavis
eik121m5:~ # rcamavis status
Checking for service amavis (amavisd-new): running
eik121m5:~ # checkproc amavisd ; echo $?
3
!!!! The above is wrong, checkproc should return 0, amavisd is active.!!!!!
!!!! 3 means no process and no pid file (maybe it was searched for /var/run/ !!!
eik121m5:~ # checkproc -p /var/spool/amavis/amavisd.pid amavisd ; echo $?
1
!!!! The above is wrong, checkproc should return 0, amavisd is active.!!!!!
!!!! 1 means no process, but there is a pid file. !!!!
eik121m5:~ # rcamavis stop
Shutting down virus-scanner (amavisd-new): Daemon [2497] terminated by SIGTERM
done
eik121m5:~ # checkproc -p /var/spool/amavis/amavisd.pid amavisd ; echo $?
3
eik121m5:~ # checkproc amavisd ; echo $?
3
eik121m5:~ #
So maybe the solution is that the pid file is stored in /var/run/, which requires a change in /usr/sbin/amavisd
checkproc exit codes were wrong previously, see bug 687547 There was a message on opensuse-factory that this was solved. However I installed a fresh RC2 and installed amavisd-new from oss, but it still has the same problem. I also tried amavisd-new from server:mail but still the same problem. The problem is in checkproc not able to find the amavis processes using the full path. However this information is available see below:
# systemctl start amavis.service
Job failed. See system logs and 'systemctl status' for details.
Despite this failure message amavisd is active.
# systemctl status amavis.service
amavis.service - LSB: Start amavisd-new
Loaded: loaded (/etc/init.d/amavis)
Active: failed since Mon, 07 Nov 2011 23:59:37 +0100; 13s ago
Process: 2573 ExecStart=/etc/init.d/amavis start (code=exited, status=7/NOTRUNNING)
CGroup: name=systemd:/system/amavis.service
├ 2583 /usr/sbin/amavisd (master)
├ 2588 /usr/sbin/amavisd (virgin child)
└ 2589 /usr/sbin/amavisd (virgin child)
Above you see that the full patch is available in the system about the amavisd processes. Maybe not at the position where checkproc is expecting it, but elsewhere.
diplicate *** This bug has been marked as a duplicate of bug 723708 *** Created attachment 463034 [details]
modified /etc/init.d/amavis to work around checkproc
I've worked around amavis sysvinit script problem by replacing checkproc with a shell script function checkproc_script that simulates the intended checkproc behavior.
*** Bug 735918 has been marked as a duplicate of this bug. *** This is an autogenerated message for OBS integration: This bug (706257) was mentioned in https://build.opensuse.org/request/show/98762 Factory / amavisd-new https://build.opensuse.org/request/show/98763 12.1 / amavisd-new *** Bug 739673 has been marked as a duplicate of this bug. *** |