[Pkg-nagios-changes] [SCM] Debian packaging for Nagios3 branch, master, updated. debian/3.4.1-2-19-g04df464
Alexander Wirt
formorer at debian.org
Thu Jun 27 05:47:58 UTC 2013
The following commit has been merged in the master branch:
commit abe9bc9da6dfca90341b450092ba3cac578e2eca
Author: Alexander Wirt <formorer at debian.org>
Date: Wed Jun 26 23:58:49 2013 +0200
Update web specific packaging for apache 2.4
diff --git a/debian/nagios3-cgi.links b/debian/nagios3-cgi.links
index c2355e5..9f7a836 100644
--- a/debian/nagios3-cgi.links
+++ b/debian/nagios3-cgi.links
@@ -1 +1,2 @@
usr/share/javascript/jquery/jquery.min.js usr/share/nagios3/htdocs/js/jquery-1.7.1.min.js
+etc/nagios3/apache2.conf etc/apache2/conf-available/nagios3.conf
diff --git a/debian/nagios3-cgi.postinst b/debian/nagios3-cgi.postinst
index 6bf16f8..8cba57f 100644
--- a/debian/nagios3-cgi.postinst
+++ b/debian/nagios3-cgi.postinst
@@ -41,58 +41,34 @@ case "$1" in
--disabled-login --force-badname nagios > /dev/null
fi
- # get the list of selected servers
- db_get nagios3/httpd
- servers=$(echo $RET | sed -e 's/,/ /g')
db_get nagios3/adminpassword
admpass="$RET"
- # get whether they want support for 1.x urls:
- db_get nagios3/nagios1-in-apacheconf
- nagiosone="$RET"
- unwanted_servers=""
+ # register apache2.conf via ucf:
+ ucf --debconf-ok /usr/share/nagios3-cgi/apache2.conf $apacheconf
- #check which servers to uninclude
- for s in $wc_httpd_supported
- do
- if ! echo $servers | grep -q $s
- then
- unwanted_servers="$s $unwanted_servers"
- fi
- done
+ echo "enabling Apache2 config..."
- # register apache2.conf via ucf:
- if [ "$nagiosone" = "true" ]; then
- ucf --debconf-ok /usr/share/doc/nagios3-common/examples/apache2.nagios1.conf $apacheconf
- else
- ucf --debconf-ok /usr/share/doc/nagios3-common/examples/apache2.conf $apacheconf
- fi
+ COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)
+ # NEW method for Apache >= 2.4
+ if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
+ . /usr/share/apache2/apache2-maintscript-helper
- # configure the web servers, if it is desired
- if [ "$servers" ]; then
- if wc_httpd_apache_include $apacheconf nagios3 $servers; then
- # reload the selected servers if they are running
- running_servers="$(wc_httpd_running $servers)"
- if [ "$running_servers" ]; then
- wc_httpd_invoke "reload" $running_servers
- fi
- fi
- fi
+ apache2_invoke enconf nagios3
- if [ "$unwanted_servers" ]; then
- servers_to_deconf="$(wc_httpd_apache_configured $apacheconf nagios3 $unwanted_servers)"
- if [ "$servers_to_deconf" ]; then
- if wc_httpd_apache_uninclude $apacheconf nagios3 $servers_to_deconf; then
- # reload the selected servers if they are running
- running_servers="$(wc_httpd_running $unwanted_servers)"
- if [ "$running_servers" ]; then
- wc_httpd_invoke "reload" $running_servers
- fi
- fi
- fi
- fi
+ # remove OLD Apache 2.2 link
+ [ -L /etc/apache2/conf.d/nagios3.conf ] && rm /etc/apache2/conf.d/nagios3.conf
+
+ # OLD methods for Apache < 2.4
+ elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
+
+ # create symlink if not existing
+ [ -f /etc/apache2/conf.d/nagios3.conf ] || ln -vs $apacheconf /etc/apache2/conf.d/nagios3.conf
+ # reload webserver
+ [ -x $(which invoke-rc.d) ] && invoke-rc.d apache2 reload
+ fi
# we reset the password every run, so if it exists we're running
# after being specifically given a password and can unconditionally set it.
--
Debian packaging for Nagios3
More information about the Pkg-nagios-changes
mailing list