DPKG_MAINTSCRIPT_PACKAGE not set by dpkg-reconfigure causing dpkg-trigger to fail

Bug #198421 reported by Caleb Case
92
This bug affects 37 people
Affects Status Importance Assigned to Milestone
debconf (Debian)
Fix Released
Unknown
debconf (Ubuntu)
Fix Released
High
Colin Watson

Bug Description

Binary package hint: debconf

When reconfiguring a package that uses dpkg-trigger it fails with:

dpkg-trigger: dpkg-trigger must be called from a maintainer script (or with a --by-package option)

For instance:

$ sudo dpkg-reconfigure selinux
dpkg-trigger: dpkg-trigger must be called from a maintainer script (or with a --by-package option)

Setting DPKG_MAINTSCRIPT_PACKAGE fixes the problem:

$ sudo DPKG_MAINTSCRIPT_PACKAGE=selinux dpkg-reconfigure selinux

The usage of dpkg-trigger indicates that this is normally setup by dpkg:
$dpkg-trigger --help
...
  --by-package=<package> Override trigger awaiter (normally set by dpkg).
...

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.04
DISTRIB_CODENAME=hardy
DISTRIB_DESCRIPTION="Ubuntu hardy (development branch)"

debconf:
  Installed: 1.5.19
  Candidate: 1.5.19
  Version table:
 *** 1.5.19 0
        500 http://us.archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status

Thanks,

Caleb

Colin Watson (cjwatson)
Changed in debconf:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Soren Hansen (soren) wrote :

Linked to a bzr branch with a fix. This should go into Debian as well (they don't have triggers yet, though, but when they do, they'll wan this as well, and until then, it does no harm). Colin, will you push+sync?

Changed in debconf:
status: Triaged → Fix Committed
Revision history for this message
Colin Watson (cjwatson) wrote :

I don't think this is quite right yet. Based on my conversation with Ian yesterday:

  * dpkg-reconfigure also needs to set DPKG_RUNNING_VERSION based on dpkg --version or similar (see e.g. initramfs-tools.postinst for the possible effects of this)
  * dpkg-reconfigure also needs to make sure that any activated triggers get run before it exits, so needs to call something like 'dpkg --triggers-only -a' at the end

Changed in debconf:
status: Fix Committed → In Progress
Revision history for this message
Soren Hansen (soren) wrote : Re: [Bug 198421] Re: DPKG_MAINTSCRIPT_PACKAGE not set by dpkg-reconfigure causing dpkg-trigger to fail

On Wed, Mar 05, 2008 at 08:11:18AM -0000, Colin Watson wrote:
> I don't think this is quite right yet. Based on my conversation with Ian
> yesterday:
>
> * dpkg-reconfigure also needs to set DPKG_RUNNING_VERSION based on dpkg --version or similar (see e.g. initramfs-tools.postinst for the possible effects of this)
> * dpkg-reconfigure also needs to make sure that any activated triggers get run before it exits, so needs to call something like 'dpkg --triggers-only -a' at the end

I've updated the branch with those changes. I'm not entirely sure if the
call to "dpkg --triggers-only -a" is in the right place, though.

--
Soren Hansen |
Virtualisation specialist | Ubuntu Server Team
Canonical Ltd. | http://www.ubuntu.com/

Revision history for this message
Soren Hansen (soren) wrote :

Have you had a chance to review the branch, Colin?

Revision history for this message
Caleb Case (calebcase) wrote :

Any updates?

Colin Watson (cjwatson)
Changed in debconf:
assignee: nobody → kamion
Revision history for this message
Chuck Ritola (cobra176) wrote :

similar problem in ubuntu-server 9.10. 'sudo dpkg-reconfigure -a ' throws "dpkg-trigger must be called by a maintainer script" and aborts.

Revision history for this message
Soren Hansen (soren) wrote :

I've just merged lp:debconf into my proposed branch. I'd still love a review of it.

Changed in debconf (Debian):
status: Unknown → New
Revision history for this message
Martin (wortheld) wrote :

duplicated my bug here -- same symptom and dpkg-reconfigure -a still broken.

Revision history for this message
Alex Garel (alex-garel) wrote :

Same here, Maverick update goes wrong (maybe because of python-profiler and python2.5, so nothing really important), the problem was ubuntu updater propose to run dpkg-reconfigure -a which is broken (failing on cron package because of this reported issue)

description: updated
Colin Watson (cjwatson)
Changed in debconf (Ubuntu):
status: In Progress → Triaged
Colin Watson (cjwatson)
Changed in debconf (Ubuntu):
importance: Medium → High
Revision history for this message
Colin Watson (cjwatson) wrote :

I've sent updated patches to the linked Debian bug.

Changed in debconf (Ubuntu):
status: Triaged → In Progress
Changed in debconf (Debian):
status: New → Fix Released
Revision history for this message
Colin Watson (cjwatson) wrote :

debconf (1.5.42ubuntu1) precise; urgency=low

  * Resynchronise with Debian. Remaining changes:
    - Gnome.pm: Do not show "Cancel" or "Close" buttons, to avoid breaking
      maintainer scripts.
  * Ubuntu's dpkg-query still uses ${PackageSpec} for multiarch support
    rather than the newer ${binary:Package}. Support this as well for now.

 -- Colin Watson <email address hidden> Thu, 15 Mar 2012 12:56:18 +0000

debconf (1.5.42) unstable; urgency=low

  [ Joey Hess ]
  * File DbDriver now creates the directory for the file if it is missing.
    (All other DbDrivers that write files already did this.) Closes: #636621

  [ Emmet Hikory ]
  * Display error messages in noninteractive frontend (Closes: #367497)

  [ Debconf translations ]
  * Polish (Michał Kułach). Closes: #657264

  [ Manpages translations ]
  * German updated.
  * Portugese updated (Américo Monteiro).
  * Spanish updated. Closes: #636241
  * Sinhala; (Danishka Navin). Closes: #641106
  * Russian updated. Closes: #656110

  [ Programs translations ]
  * Norwegian Bokmål updated. Closes: #654798

  [ Joey Hess ]
  * Add a belt-and-suspenders test that Text::CharWidth::mblen is not
    returning bogus values, before using Text::WrapI18n. See #641957
  * Avoid an uninitialized value warning when a blank line is received
    from the client. Closes: #651642

  [ Colin Watson ]
  * Remove all hardcoded executable paths, using a new Debconf::Path module.

  [ Raphaël Hertzog ]
  * Set environment variables expected by maintainer scripts. Closes:
    #560317
  * Do not hardcode the path of maintainer scripts, in order to support the
    multiarch layout.

  [ Colin Watson ]
  * Process any newly pending triggers after running maintainer scripts.

 -- Colin Watson <email address hidden> Wed, 14 Mar 2012 09:08:49 +0000

Changed in debconf (Ubuntu):
status: In Progress → 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.