Remove redundant code from resolvconf postinst

Bug #931335 reported by Thomas Hood on 2012-02-13
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
resolvconf (Ubuntu)
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

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) on 2012-02-16
Changed in resolvconf (Ubuntu):
status: New → Incomplete
status: Incomplete → Triaged
importance: Undecided → Low
Thomas Hood (jdthood) wrote :

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

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
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
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  Edit
Everyone can see this information.

Other bug subscribers