[omd-commits] OMD Git: omd: deb: Added handling of apache directories conf-available/ conf-enabled instead of conf.d

git version control git at mathias-kettner.de
Tue Oct 22 13:34:20 CEST 2013


Module:   omd
Branch:   master
Commit:   e5e95a5a4ea8312c68de5b984a41c5fce2cac227
URL:      http://omdistro.org/projects/omd/repository/revisions/e5e95a5a4ea8312c68de5b984a41c5fce2cac227

Author:   Lars Michelsen <lm at mathias-kettner.de>
Date:     Tue Oct 22 13:34:15 2013 +0200
Commiter: Lars Michelsen <lm at mathias-kettner.de>
Date:     Tue Oct 22 13:34:15 2013 +0200

deb: Added handling of apache directories conf-available/conf-enabled instead of conf.d

---

 Changelog          |    1 +
 debian/postinst.in |   13 ++++++++++++-
 debian/postrm.in   |    4 ++++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index fd0ab8c..d4604c8 100644
--- a/Changelog
+++ b/Changelog
@@ -21,6 +21,7 @@ This file documents the revision history for the Open Monitoring Distribution
           - Init scripts can now deal with upstart user sessions, where the
             PPID is not 1 anymore, instead of it the PPID is the user session
             init process (init --user). This was first seen on ubuntu 13.10.
+          - Added build support on Ubuntu 13.10 (Saucy Salamander)
 
 1.00     Jun 17 2013
           - Nagios: Update to 3.5.0
diff --git a/debian/postinst.in b/debian/postinst.in
index ce22b4c..882f5b5 100755
--- a/debian/postinst.in
+++ b/debian/postinst.in
@@ -68,12 +68,23 @@ case "$1" in
     done
 
     db_stop
-    # -- create apache conf.d if not exist
+    # -- create apache config include if not exist
+    if test -d /etc/apache2/conf-available; then
+      # On e.g. ubuntu 13.10 conf.d is not loaded anymore, use conf-available
+      APACHE_OMD_CONF="/etc/apache2/conf-available/zzz_omd.conf"
+    fi
+
     if ! test -e $APACHE_OMD_CONF; then
       echo "Include /omd/apache/*.conf" > $APACHE_OMD_CONF
       # avoid apache error message including /omd/apache if no site exist
       touch "/omd/apache/empty.conf"
+
+      # -- enable conf include, when available
+      if test -d /etc/apache2/conf-available; then
+        a2enconf zzz_omd
+      fi
     fi
+
     # -- enable apache modules
     if ! test -e /etc/apache2/mods-enabled/proxy_http.load; then
        a2enmod proxy_http	# also enables dependend modules
diff --git a/debian/postrm.in b/debian/postrm.in
index ec1eda8..58b53be 100644
--- a/debian/postrm.in
+++ b/debian/postrm.in
@@ -40,6 +40,10 @@ case "$1" in
 	  # rm -f /usr/share/man/man8/omd.8.gz # -> alternatives
 	  # rm -f /etc/init.d/omd # -> alternatives
 	  rm -f /etc/default/omd
+          if test -d /etc/apache2/conf-available; then
+            # On e.g. ubuntu 13.10 conf.d is not used anymore, use conf-available
+            APACHE_OMD_CONF="/etc/apache2/conf-available/zzz_omd.conf"
+          fi
 	  rm -f $APACHE_OMD_CONF $APACHE_OMD_EMPTY_CONF
 	  rm -f /omd
 	  # Try to remove empty directories



More information about the omd-commits mailing list