[SRU] amavis start-stop script fails to stop amavisd

Bug #930916 reported by albatros on 2012-02-12
42
This bug affects 7 people
Affects Status Importance Assigned to Milestone
amavisd-new (Debian)
Fix Released
Unknown
amavisd-new (Ubuntu)
High
James Page
Precise
High
James Page
Quantal
High
James Page

Bug Description

[Impact]
sudo service amavis restart completely fails to restart the amavis daemon.

[Development Fix]
Drop use of --name flag with start-stop-daemon as this is surplus to requirements and is the root cause of this issue. This was applied in Debian in revision 1:2.7.0-1

[Stable Fix]
Cherry pick same changes to init script from latest version.

[Test Case]
Running the unfixed version of the package
1) sudo apt-get install amavisd-new
2) sudo service amavis restart
3) Observe
Stopping amavisd: (not running).
Starting amavisd: The amavisd daemon is already running, PID: [{xxx}] (failed).

With the version of the package in -proposed step 2/3 should not fail.

[Regression Potential]
Minimal - very isolated change in init script which only impacts this package.

[Original Bug Report]
On Ubuntu 12.04 Precise Pangolin using amavisd-new 2.6.5-0ubuntu3 the amavis start-stop script fails to stop the daemon.

What occurs is the following:
sudo service amavis restart
Stopping amavisd: (not running).
Starting amavisd: The amavisd daemon is already running, PID: [{xxx}] (failed).

The installer script for amavisd-new has some errors as well probably related(?).

Apparently this behavior has been reported for Debian:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652026 and fixed in package version 2.7.0-1

albatros (jda) wrote :

An easy fix:

In /etc/init.d/amavis:
replace the line
STOP="--stop --quiet --pidfile $PIDFILE --name ${DAEMONNAME}"
with
STOP="--stop --quiet --pidfile $PIDFILE"

Serge Hallyn (serge-hallyn) wrote :

Marking confirmed based on debian report.

Changed in amavisd-new (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Changed in amavisd-new (Debian):
status: Unknown → Fix Released
Vibhav Pant (vibhavp) wrote :

Attached Fix.

Daniel Holbach (dholbach) wrote :

Thanks Vibhav for your work on this.

Can you verify that in your patch you replaced the old debian/amavisd-new.init with the new debian/amavisd-new.init? Because the changes in the attached patch are rather large.

Vibhav Pant (vibhavp) wrote :

I have verified the patch again.

albatros (jda) wrote :

Looking at it & reading the Debian package's changelog I think the only thing to fix this has been removing the check for the uid of the running process when stopping the process. The necessary patch might be limited to something like the attached file.

albatros (jda) wrote :

Sorry I have not put the correct paths in the patch....

Daniel Holbach (dholbach) wrote :

What I found was the following:

daniel@daydream:~$ diff -ruN amavisd-new-2.{6.5,7.0}/debian/amavisd-new.init
--- amavisd-new-2.6.5/debian/amavisd-new.init 2012-03-05 11:15:35.000000000 +0100
+++ amavisd-new-2.7.0/debian/amavisd-new.init 2012-03-05 11:15:43.000000000 +0100
@@ -41,8 +41,8 @@

 set -e

-START="--start --quiet --pidfile $PIDFILE --name ${DAEMONNAME} --startas ${DAEMON}"
-STOP="--stop --quiet --pidfile $PIDFILE --name ${DAEMONNAME}"
+START="--start --quiet --pidfile $PIDFILE --startas ${DAEMON}"
+STOP="--stop --quiet --pidfile $PIDFILE"
 PARAMS=

 check_noncompatible_upgrade() {
daniel@daydream:~$

Daniel Holbach (dholbach) wrote :

Can somebody please go and test the current amavisd-new in Ubuntu precise and make sure it still works with the init script changes above?

Daniel Holbach (dholbach) wrote :

Until then I'll unsubscribe the 'ubuntu-sponsors' team, please re-subscribe when ready.

tags: added: rls-p-tracking
albatros (jda) wrote :

The changes in #8 work.

Mike C (mconigliaro) wrote :

The changes in #8 work for me too.

Changed in amavisd-new (Ubuntu):
assignee: nobody → Clint Byrum (clint-fewbar)
Thomas M Steenholdt (tmus) wrote :

Any reason why this fix has not gone into "final" precise?

James Page (james-page) on 2012-05-22
Changed in amavisd-new (Ubuntu):
assignee: Clint Byrum (clint-fewbar) → James Page (james-page)
James Page (james-page) on 2012-05-22
Changed in amavisd-new (Ubuntu Quantal):
status: Confirmed → Fix Released
Changed in amavisd-new (Ubuntu Precise):
importance: Undecided → High
assignee: nobody → James Page (james-page)
status: New → In Progress
James Page (james-page) on 2012-05-22
summary: - amavis start-stop script fails to stop amavisd
+ [SRU] amavis start-stop script fails to stop amavisd
description: updated
James Page (james-page) wrote :

Uploaded to precise-proposed ready for SRU team review.

Hello albatros, or anyone else affected,

Accepted amavisd-new into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in amavisd-new (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
description: updated
Vibhav Pant (vibhavp) wrote :

amavisd-new in proposed works for me

tags: added: verification-done
removed: verification-needed
James Page (james-page) on 2012-05-31
Changed in amavisd-new (Ubuntu Precise):
milestone: none → ubuntu-12.04.1
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package amavisd-new - 1:2.6.5-0ubuntu3.1

---------------
amavisd-new (1:2.6.5-0ubuntu3.1) precise-proposed; urgency=low

  * Fix init script so that 'service amavisd restart' works (LP: #930916):
    - d/amavisd-new.init: Remove use of --name flag with start-stop-daemon
      to ensure that service can be restarted.
      Cherry picked from packaging in 1:2.7.1-1.
 -- James Page <email address hidden> Tue, 22 May 2012 18:48:19 +0100

Changed in amavisd-new (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.