Remove redundant code from resolvconf postinst

Bug #931335 reported by Thomas Hood
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
resolvconf (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

For earlier discussion please see #929552.

Resolvconf preinst has to create run-time directories. Resolvconf postinst has to enable updates. (They of course do other things which aren't relevant here.)

Resolvconf's Upstart job does both; /etc/init/resolvconf.conf contains code like this:

    [...]
    start on mounted MOUNTPOINT=/run
    pre-start script
        mkdir -p /run/resolvconf/interface
        touch /run/resolvconf/postponed-update
        resolvconf --enable-updates
    end script
    [...]

Now, resolvconf postinst runs the Upstart job by means of

    invoke-rc.d resolvconf start

where /etc/init.d/resolvconf is a symlink to /lib/init/upstart-job.

Because resolvconf postinst runs the upstart job which enables updates it is not necessary for the postinst to enable updates itself. Currently it does so by triggering itself and enabling updates when "$1" = triggered. The section of the postinst that does this is redundant and should be removed. See attachment for patch. The file debian/triggers should also be removed.

(Background: In Debian, resolvconf.postinst triggers itself and only enables updates in the "triggered" phase; this avoid redundant update runs when resolvconf is installed along with packages whose postinsts induce resolvconf-updates.)
--
Thomas Hood

Tags: patch
Revision history for this message
Thomas Hood (jdthood) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "resolvconf-postinst-deredundantify_20120213th1.diff" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Steve Langasek (vorlon)
Changed in resolvconf (Ubuntu):
status: New → Incomplete
status: Incomplete → Triaged
importance: Undecided → Low
Revision history for this message
Thomas Hood (jdthood) wrote :

Can you please apply the patch I contributed to the quantal version of the package (currently 1.65ubuntu1)?

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

This bug was fixed in the package resolvconf - 1.65ubuntu3

---------------
resolvconf (1.65ubuntu3) quantal; urgency=low

  [ Stéphane Graber ]
  * Call db_go after the db_input command so that the debconf error
    message is actually shown to the user.

  [ Thomas Hood ]
  * Remove redundant code from resolvconf postinst (LP: #931335)
 -- Stephane Graber <email address hidden> Mon, 14 May 2012 12:49:42 -0400

Changed in resolvconf (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Thomas Hood (jdthood) wrote :

The file debian/triggers should also be removed, otherwise the postinst will still be run with "triggered" (and do nothing). Thanks to Nathan Stratton Treadway for the nudge.

Changed in resolvconf (Ubuntu):
status: Fix Released → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package resolvconf - 1.65ubuntu4

---------------
resolvconf (1.65ubuntu4) quantal; urgency=low

  * Also remove debian/triggers to avoid needlessly calling resolvconf's
    postinst. (LP: #931335)
 -- Stephane Graber <email address hidden> Mon, 14 May 2012 16:40:55 -0400

Changed in resolvconf (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.