Upgrade to 10.04 beta1 blocked by aiccu

Bug #544910 reported by stijnbe
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
aiccu (Debian)
Fix Released
Unknown
aiccu (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: aiccu

When upgrading ubuntu from 9.10 to 10.04 beta1. The upgrade process got blocked by aiccu (Starting aiccu...). I solved the problem by doing:

sudo aiccu stop

Related branches

Changed in aiccu (Debian):
status: Unknown → New
Revision history for this message
Marien Zwart (marienz) wrote :

This does not just break upgrading, the same thing happens when installing aiccu on an already-running system.

What seems to be going on is this:

- debconf launches the postinst script, using an extra pipe
  (connected to fd 3 in the script) to communicate.

- The postinst script eventually launches aiccu, which inherits fd 3.

- aiccu daemonizes, keeping fd 3 open.

- The postinst script terminates.

- debconf remains blocked trying to read from the pipe.

That is: I see this from ps:

/usr/bin/dpkg --status-fd 25 --configure aiccu
  /usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/aiccu.postinst configure
    [aiccu.postinst] <defunct>
/usr/sbin/aiccu start

with strace/gdb showing that aiccu is running normally and the perl process is blocked trying to read from a pipe, and /proc telling me that same pipe is connected to fd 3 of the aiccu process. Killing aiccu (killall aiccu or /etc/init.d/aiccu stop) gets debconf unstuck.

As far as I can tell a reasonable way of fixing this is for aiccu to close all its fds when it daemonizes. Some googling indicates you're "supposed" to do that (see for example http://www.python.org/dev/peps/pep-3143/#correct-daemon-behaviour which refers to a book and a couple of implementations). Unfortunately upstream disagrees with me, and I'm not sure where else this could be fixed. Can the postinst script (which does not explicitly use this fd anywhere) reasonably close it somehow? Should invoke-rc.d close all fds? Should /etc/init.d/aiccu?

I will attach the patch doing this in aiccu (the one rejected upstream) here. My ppa ( https://launchpad.net/~marienz/+archive/ppa ) has a build with this patch applied (and a lot of other stuff, so please do not blindly add the entire ppa to get past this bug!)

Revision history for this message
Marien Zwart (marienz) wrote :
Revision history for this message
Philipp Kern (pkern) wrote : Re: [Bug 544910] Re: Upgrade to 10.04 beta1 blocked by aiccu

On Tue, Apr 27, 2010 at 11:13:41PM -0000, Marien Zwart wrote:
> As far as I can tell a reasonable way of fixing this is for aiccu to
> close all its fds when it daemonizes. Some googling indicates you're
> "supposed" to do that (see for example
> http://www.python.org/dev/peps/pep-3143/#correct-daemon-behaviour which
> refers to a book and a couple of implementations). Unfortunately
> upstream disagrees with me, and I'm not sure where else this could be
> fixed. Can the postinst script (which does not explicitly use this fd
> anywhere) reasonably close it somehow? Should invoke-rc.d close all fds?
> Should /etc/init.d/aiccu?
>
> I will attach the patch doing this in aiccu (the one rejected upstream)
> here. My ppa ( https://launchpad.net/~marienz/+archive/ppa ) has a build
> with this patch applied (and a lot of other stuff, so please do not
> blindly add the entire ppa to get past this bug!)

What about calling Debconf's db_stop? (This is implemented by sending
STOP to fd3.)

Kind regards,
Philipp Kern
--
 .''`. Philipp Kern Debian Developer
: :' : http://philkern.de Stable Release Manager
`. `' xmpp:phil@0x539.de Wanna-Build Admin
  `- finger <email address hidden>

Revision history for this message
Marien Zwart (marienz) wrote :

That does indeed fix it (I should have read the debconf documentation and figured this out myself...).

Updated package is in my ppa (it just has a db_stop call added after "db_reset aiccu/password").

Revision history for this message
clou (thorsten-becker) wrote :

Had the Problem on 3 systems on upgrade to version 10.04.

Revision history for this message
Jean-Louis Dupond (dupondje) wrote :

Same issue when upgrading to 10.10 ! This should be fixed :)

tags: added: patch
Changed in aiccu (Ubuntu):
status: New → Confirmed
Revision history for this message
Jean-Louis Dupond (dupondje) wrote :
Revision history for this message
Jean-Louis Dupond (dupondje) wrote :
Revision history for this message
Jean-Louis Dupond (dupondje) wrote :

Posted patch upstream, lets hope they pick it up

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package aiccu - 20070115-12ubuntu1

---------------
aiccu (20070115-12ubuntu1) maverick; urgency=low

  * Added patch 09_close_fds.patch (LP: #544910)
 -- Jean-Louis Dupond <email address hidden> Thu, 27 May 2010 22:04:41 +0200

Changed in aiccu (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Daniel T Chen (crimsun) wrote :

For recordkeeping, I uploaded this, too:

aiccu (20070115-12ubuntu2) maverick; urgency=low

 * Use the intended debconf fix instead.

Revision history for this message
Reinier Haasjes (reinier) wrote :

> Posted patch upstream, lets hope they pick it up

The patch is in 20070115-13.

Changed in aiccu (Debian):
status: New → Fix Committed
Changed in aiccu (Debian):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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