Code

pnp4nagios-web.postinst: Don't call a2mod / restart apache2 unconditionally.
authorSebastian Harl <sh@tokkee.org>
Tue, 31 Jan 2012 08:47:01 +0000 (09:47 +0100)
committerSebastian Harl <sh@tokkee.org>
Tue, 31 Jan 2012 08:47:01 +0000 (09:47 +0100)
… rather, only if the binaries are available.

Thanks to Wouter Schoot for reporting this.
Closes: #636218
debian/changelog
debian/pnp4nagios-web.postinst

index 9d82bf92673be9afe17a3fef020593cadd208fba..eae8c57b195ee5aec3f6b3027e68a1198f59aa87 100644 (file)
@@ -8,8 +8,11 @@ pnp4nagios (0.6.16-1) unstable; urgency=low
     - Added recommended targets build-{arch,indep} depending on build-stamp.
   * debian/pnp4nagios-bin.install:
     - Install verify_pnp_config_v2.pl to /u/l/pnp4nagios/libexec/.
+  * debian/pnp4nagios-web.postinst:
+    - Call a2mod / restart apache2 only if the binaries are available; thanks
+      to Wouter Schoot for reporting this (Closes: #636218).
 
- -- Sebastian Harl <tokkee@debian.org>  Tue, 31 Jan 2012 09:38:49 +0100
+ -- Sebastian Harl <tokkee@debian.org>  Tue, 31 Jan 2012 09:45:56 +0100
 
 pnp4nagios (0.6.13-1) unstable; urgency=low
 
index f5f2597ef211862f14a182d7e065fa974a37c2a6..feb27e725a3fe94015e9e32f1280b70e2f8de31e 100644 (file)
@@ -44,13 +44,17 @@ configure_apache2() {
 
        if [ -d /etc/apache2/mods-enabled ]; then
                if [ ! -e /etc/apache2/mods-enabled/rewrite.load ]; then
-                       a2enmod rewrite
-                       a2reload="true"
+                       if [ -x /usr/sbin/a2enmod ]; then
+                               a2enmod rewrite
+                               a2reload="true"
+                       fi
                fi
        fi
 
        if [ "$a2reload" = "true" ]; then
-               invoke-rc.d apache2 reload
+               if [ -x /etc/init.d/apache2 ]; then
+                       invoke-rc.d apache2 reload
+               fi
        fi
 }