[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#681545: apache2-dev: dh_apache2 postinst action should run during more actions

Package: apache2-dev
Version: 2.4.2-2
Severity: normal

The default postinst code generated by dh_apache2 is:

if [ "$1" = "configure" ] && true; then
        if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
                . /usr/share/apache2/apache2-maintscript-helper
                for conf in webkdc  ; do
                        apache2_invoke enmod $conf  || exit 0

and therefore doesn't run unless the postinst action is configure.
This is a common error in maintainer scripts; it is incorrect in various
error situations.  In general, the dpkg maintainer script design tries
to allow actions to be run unconditionally.  Without a condition, the
error fallbacks usually work properly.

In addition to configure, postinst can also be invovked in the following

- abort-upgrade: prerm upgrade fails or preinst upgrade fails.  Probably
  not significant for most modules, but calling enmod in those cases is
  certainly not wrong and at worst results in an unnecessary Apache

- abort-remove: prerm remove failed.  The module may have dismod'd by the
  remove action (if the package maintainer chose to do this in prerm
  instead of postrm) and then a later remove action failed, which means
  that we need to enmod the module again in order to correctly recover.

- abort-deconfigure: prerm deconfigure failed.  This is what's used for
  a Breaks state, so similarly the module may have been dismod'd by the
  deconfigure action and enmod is required to properly roll back.

I believe you should therefore just remove this conditional and run this
code in postinst unconditionally.

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-2-686-pae (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages apache2-dev depends on:
ii  apache2          2.4.2-2
ii  debhelper        9.20120608
ii  libapr1-dev      1.4.6-3
ii  libaprutil1-dev  1.4.1-2
ii  openssl          1.0.1c-3
ii  perl             5.14.2-12

apache2-dev recommends no packages.

apache2-dev suggests no packages.

-- no debconf information

Reply to: