[Pkg-nagios-changes] [pkg-icinga-web] 02/04: Improve and fail-safe icinga2 interaction
Markus Frosch (old DM Account)
lazyfrosch-guest at moszumanska.debian.org
Wed Mar 11 14:32:09 UTC 2015
This is an automated email from the git hooks/post-receive script.
lazyfrosch-guest pushed a commit to branch master
in repository pkg-icinga-web.
commit a0f14b7e14183e0990c0e0e757135edb9233fc79
Author: Markus Frosch <markus at lazyfrosch.de>
Date: Wed Jan 21 20:47:56 2015 +0100
Improve and fail-safe icinga2 interaction
---
.../icinga-web-config-icinga2-ido-mysql.postinst | 25 +++++++++++++------
.../icinga-web-config-icinga2-ido-pgsql.postinst | 28 +++++++++++++++-------
2 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/debian/icinga-web-config-icinga2-ido-mysql.postinst b/debian/icinga-web-config-icinga2-ido-mysql.postinst
index 7497ab2..202b836 100644
--- a/debian/icinga-web-config-icinga2-ido-mysql.postinst
+++ b/debian/icinga-web-config-icinga2-ido-mysql.postinst
@@ -30,14 +30,25 @@ is_fresh_install()
enable_icinga2_commandpipe() {
if is_fresh_install $@; then
echo "enabling icinga2 features for classicui"
- if [ -e "/usr/sbin/icinga2-enable-feature" ]
+ if [ -e "/etc/icinga2/features-available/command.conf" ] &&
+ [ ! -e "/etc/icinga2/features-enabled/command.conf" ]
then
- icinga2-enable-feature command
- else
- icinga2 feature enable command
+ do_reload=0
+ if [ -x "/usr/sbin/icinga2-enable-feature" ]; then
+ if icinga2-enable-feature command; then
+ do_reload=1
+ fi
+ elif [ -x "/usr/sbin/icinga2" ]; then
+ if icinga2 feature enable command; then
+ do_reload=1
+ fi
+ fi
+
+ if [ "$do_reload" = "1" ]; then
+ echo "reloading icinga2"
+ [ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload || true
+ fi
fi
- echo "reloading icinga2"
- [ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload
fi
}
@@ -71,7 +82,7 @@ generate_dbxml() {
# leave when dbconfig not enabled
if [ "$dbc_install" != "true" ]; then
- echo "database config failed: dbconfig-common for \"$(basename $dbconfig .conf)\" not enabled!"
+ echo "database config failed: dbconfig-common for \"$(basename $dbconfig .conf)\" not enabled!"
exit 1
fi
diff --git a/debian/icinga-web-config-icinga2-ido-pgsql.postinst b/debian/icinga-web-config-icinga2-ido-pgsql.postinst
index f62334d..ea341a2 100644
--- a/debian/icinga-web-config-icinga2-ido-pgsql.postinst
+++ b/debian/icinga-web-config-icinga2-ido-pgsql.postinst
@@ -30,15 +30,25 @@ is_fresh_install()
enable_icinga2_commandpipe() {
if is_fresh_install $@; then
echo "enabling icinga2 features for classicui"
- if [ -e "/usr/sbin/icinga2-enable-feature" ]
+ if [ -e "/etc/icinga2/features-available/command.conf" ] &&
+ [ ! -e "/etc/icinga2/features-enabled/command.conf" ]
then
- icinga2-enable-feature command
- else
- icinga2 feature enable command
- fi
-
- echo "reloading icinga2"
- [ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload
+ do_reload=0
+ if [ -x "/usr/sbin/icinga2-enable-feature" ]; then
+ if icinga2-enable-feature command; then
+ do_reload=1
+ fi
+ elif [ -x "/usr/sbin/icinga2" ]; then
+ if icinga2 feature enable command; then
+ do_reload=1
+ fi
+ fi
+
+ if [ "$do_reload" = "1" ]; then
+ echo "reloading icinga2"
+ [ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload || true
+ fi
+ fi
fi
}
@@ -72,7 +82,7 @@ generate_dbxml() {
# leave when dbconfig not enabled
if [ "$dbc_install" != "true" ]; then
- echo "database config failed: dbconfig-common for \"$(basename $dbconfig .conf)\" not enabled!"
+ echo "database config failed: dbconfig-common for \"$(basename $dbconfig .conf)\" not enabled!"
exit 1
fi
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-icinga-web.git
More information about the Pkg-nagios-changes
mailing list