postinst using both update-inetd and debconf hangs on first install

Bug #601732 reported by Cezary Dendek on 2010-07-05
30
This bug affects 2 people
Affects Status Importance Assigned to Milestone
approx (Ubuntu)
Undecided
Unassigned
Lucid
Undecided
Unassigned
Maverick
Undecided
Unassigned
cernlib (Debian)
Fix Released
Unknown
cernlib (Ubuntu)
Low
Unassigned
Lucid
Undecided
Unassigned
Maverick
Undecided
Unassigned
update-inetd (Ubuntu)
Undecided
Unassigned
Lucid
Undecided
Unassigned
Maverick
Undecided
Unassigned

Bug Description

Binary package hint: cernlib

update-inetd's Perl module will start, stop, or restart the installed inetd as appropriate, by calling "invoke-rc.d $service $action". However, if a postinst calling update-inetd is also using the debconf shell script module, it will have an open fd 3 which it uses to communicate with debconf.

openbsd-inetd, at least, doesn't clean up file descriptors when it starts, meaning it keeps the fd 3 which was opened by the shell script, then passed to update-inetd, then passed to invoke-rc.d, then passed to inetd.

The debconf frontend waits for that fd to close to indicate that the postinst is finished running. Since inetd has the fd open forever, that doesn't happen, and the postinst hangs.

IMPACT: Installing a package that uses update-intd and debconf when inetd previously had no jobs configured will hang.

DEVELOPMENT: This was fixed in update-inetd 4.37 by having update-inetd's Perl module explicitly close fd 3 when it starts inetd.

PATCH: Available in the associated branches (~broder/ubuntu/maverick/update-inetd/fix-601732 and ~broder/ubuntu/lucid/update-inetd/fix-601732). In both cases, the fix is a direct, unmodified backport of the patch from update-inetd 4.38. It applied to both without any fuzz.

INSTRUCTIONS:
 1. Make sure that inetd is stopped, and has no services configured.
 2. Install pawserv or approx or any package that uses both inetd and debconf.
 3. Observe hang (or hopefully lack thereof)

REGRESSION: Should be limited. The diff adds several lines of explanatory comments, but only changes one line of code in a pretty straightforward way.

========
Old summary: package pawserv 2006.dfsg.2-14ubuntu2 failed to install/upgrade: postinst hang in /usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/pawserv.postinst configure

Old description [changed by broder]:

During postinst 'pawserv.postinst' become a zombie process - further installation/configuration of packages (using synaptic) has been possible by killing (15) 'frontend' process.

ProblemType: Package
DistroRelease: Ubuntu 10.04
Package: pawserv 2006.dfsg.2-14ubuntu2
ProcVersionSignature: Ubuntu 2.6.32-23.37-generic 2.6.32.15+drm33.5
Uname: Linux 2.6.32-23-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Mon Jul 5 02:25:10 2010
ErrorMessage: subprocess installed post-installation script killed by signal (Terminated)
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
SourcePackage: cernlib
Title: package pawserv 2006.dfsg.2-14ubuntu2 failed to install/upgrade: subprocess installed post-installation script killed by signal (Terminated)

Related branches

Cezary Dendek (cezary-dendek) wrote :
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.

I can reproduce it but only on the first installation of the package. The running processes at the time of the hang were:
root 13761 0.0 1.3 9832 6784 pts/5 Ss+ 11:14 0:00 /usr/bin/dpkg --status-fd 30 --configure cernlib-base libgfortran3 libkernlib1-gfortran libpacklib1-gfortran pawserv
root 13777 0.1 1.7 11980 8832 pts/5 S+ 11:14 0:00 /usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/pawserv.postinst configure
root 13784 0.0 0.0 0 0 pts/5 Z+ 11:14 0:00 [pawserv.postins] <defunct>

This could be a problem with debconf. killing the perl process and running the install again allow to install the package.
Purging and reinstalling the package doesn't reproduce the issue.

Changed in cernlib (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
summary: package pawserv 2006.dfsg.2-14ubuntu2 failed to install/upgrade:
- subprocess installed post-installation script killed by signal
- (Terminated)
+ postinst hang in /usr/bin/perl -w /usr/share/debconf/frontend
+ /var/lib/dpkg/info/pawserv.postinst configure
Changed in cernlib (Debian):
status: Unknown → New

This has been fixed in version 4.38 of update-inetd, which is in natty, so marking as fix released.

I'm also going to work on an SRU for lucid and maverick.

Changed in approx (Ubuntu):
status: New → Invalid
Changed in cernlib (Ubuntu):
status: Confirmed → Invalid
Changed in update-inetd (Ubuntu):
status: New → Fix Released
Changed in approx (Ubuntu Lucid):
status: New → Invalid
Changed in approx (Ubuntu Maverick):
status: New → Invalid
Changed in cernlib (Ubuntu Lucid):
status: New → Invalid
Changed in cernlib (Ubuntu Maverick):
status: New → Invalid
Evan Broder (broder) on 2010-11-12
description: updated
description: updated
summary: - package pawserv 2006.dfsg.2-14ubuntu2 failed to install/upgrade:
- postinst hang in /usr/bin/perl -w /usr/share/debconf/frontend
- /var/lib/dpkg/info/pawserv.postinst configure
+ postinst using both update-inetd and debconf hangs on first install

I tested and confirmed this bug on a maverick system by installing approx. Building and installing the branch allows to approx to properly install without hanging here, and the code change looks sane to me.

Recommending that this be merged and uploaded by a core dev for maverick; I'm not able to test on lucid at this time.

Jonathan Riddell (jr) wrote :

Uploaded lp:~broder/ubuntu/maverick/update-inetd/fix-601732 to maverick-proposed, awaiting approval

Accepted update-inetd into maverick-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 update-inetd (Ubuntu Maverick):
status: New → Fix Committed
tags: added: verification-needed
Evan Broder (broder) wrote :

Installing approx and openbsd-inetd no longer hangs with update-inetd 4.36ubuntu0.1

tags: added: verification-done
removed: verification-needed
Evan Broder (broder) wrote :

Unsubscribing sponsors from the bug - the merge proposal itself shows up on the sponsoring queue

Colin Watson (cjwatson) on 2010-11-29
description: updated
Colin Watson (cjwatson) wrote :

The diff from 4.35 (lucid) to 4.36 (maverick) is trivial, so this should be fine for lucid too. Sponsoring. Thanks Evan!

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-inetd - 4.36ubuntu0.1

---------------
update-inetd (4.36ubuntu0.1) maverick-proposed; urgency=low

  * Workaround debconf hanging by closing fd 3 in invoke-rc.d invocation
    (LP: #601732) Patch from Ben Hutchings <email address hidden>
 -- Evan Broder <email address hidden> Fri, 12 Nov 2010 08:07:22 -0800

Changed in update-inetd (Ubuntu Maverick):
status: Fix Committed → Fix Released
Martin Pitt (pitti) wrote :

Accepted update-inetd into lucid-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 update-inetd (Ubuntu Lucid):
status: New → Fix Committed
tags: removed: verification-done
tags: added: verification-needed
Evan Broder (broder) wrote :

Thanks, Martin. update-inetd 4.35ubuntu0.1 in lucid-proposed fixes the issue as well.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-inetd - 4.35ubuntu0.1

---------------
update-inetd (4.35ubuntu0.1) lucid-proposed; urgency=low

  * Workaround debconf hanging by closing fd 3 in invoke-rc.d invocation
    (LP: #601732) Patch from Ben Hutchings <email address hidden>
 -- Evan Broder <email address hidden> Mon, 29 Nov 2010 13:53:07 +0000

Changed in update-inetd (Ubuntu Lucid):
status: Fix Committed → Fix Released
Changed in cernlib (Debian):
status: New → 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.