Comment 3 for bug 1453185

Revision history for this message
Thomas Hood (jdthood) wrote :

In the Debian postinst there is a case clause at the end whose purpose is to enable updates. In Debian this is done by means of a trigger.

----------------resolvconf 1.77 ----------------
[...]
case "$1" in
  reconfigure)
                resolvconf --enable-updates
        ;;
  configure)
        if [ "$DEBCONF_RECONFIGURE" = 1 ] ; then
                resolvconf --enable-updates
        else
                # Trigger self to enable updates later
                dpkg-trigger --no-await resolvconf-enable-updates || resolvconf --enable-updates
        fi
        ;;
  triggered)
        # Runs after this and other packages have been configured
        for trggr in $2 ; do
                case "$trggr" in
                  resolvconf-enable-updates)
                        resolvconf --enable-updates
                        break
                        ;;
                esac
        done
        ;;
[...]
--------------------------------

The Ubuntu postinst omits that whole clause. In the Upstart era updates were enabled by means of an "invoke-rc.d resolvconf start" at the end of the file, inserted by dh_installinit called without "--no-start".

--------------- resolvconf 1.69ubuntu1 -----------------
[...]
# Automatically added by dh_installinit
if [ -x "/etc/init.d/resolvconf" ]; then
        if [ ! -e "/etc/init/resolvconf.conf" ]; then
                update-rc.d resolvconf defaults >/dev/null
        fi
        invoke-rc.d resolvconf start || exit $?
fi
# End automatically added section
# Automatically added by dh_installinit
update-rc.d -f resolvconf remove >/dev/null || exit $?
# End automatically added section

exit 0
--------------------------------

I would suggest that Ubuntu resolvconf's postinst simply add a clause at the end, like the one in Debian, which runs "resolvconf --enable-updates" on configure. This will minimize the diff with the Debian postinst.

For background on the sorts of problems that can arise when changes are made to the postinst that haven't been fully thought through, see bug #1085862.