[icinga-checkins] icinga.org: icinga2/master: Fix the init script

git at icinga.org git at icinga.org
Wed Nov 26 08:16:19 CET 2014


Module: icinga2
Branch: master
Commit: 9f0e0aac869b2ca7c7b9e438eb6cb4414cbf0978
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=9f0e0aac869b2ca7c7b9e438eb6cb4414cbf0978

Author: Gunnar Beutner <gunnar at beutner.name>
Date:   Wed Nov 26 06:40:24 2014 +0100

Fix the init script

refs #7613

---

 etc/initsystem/icinga2-prepare-dirs |    4 +++-
 etc/initsystem/icinga2.init.d.cmake |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/etc/initsystem/icinga2-prepare-dirs b/etc/initsystem/icinga2-prepare-dirs
index 245f065..5317da7 100644
--- a/etc/initsystem/icinga2-prepare-dirs
+++ b/etc/initsystem/icinga2-prepare-dirs
@@ -25,7 +25,9 @@ if [ $? != 0 ]; then
         exit 6
 fi
 
-getent group $ICINGA2_COMMAND_GROUP >/dev/null 2>&1 || echo "Command group '$ICINGA2_COMMAND_GROUP' does not exist. Exiting." && exit 6
+getent passwd $ICINGA2_USER >/dev/null 2>&1 || (echo "Icinga user '$ICINGA2_USER' does not exist. Exiting." && exit 6)
+getent group $ICINGA2_GROUP >/dev/null 2>&1 || (echo "Icinga group '$ICINGA2_GROUP' does not exist. Exiting." && exit 6)
+getent group $ICINGA2_COMMAND_GROUP >/dev/null 2>&1 || (echo "Icinga command group '$ICINGA2_COMMAND_GROUP' does not exist. Exiting." && exit 6)
 
 mkdir -p $(dirname -- $ICINGA2_PID_FILE)
 chown $ICINGA2_USER:$ICINGA2_GROUP $(dirname -- $ICINGA2_PID_FILE)
diff --git a/etc/initsystem/icinga2.init.d.cmake b/etc/initsystem/icinga2.init.d.cmake
index 4ec65e4..c474193 100644
--- a/etc/initsystem/icinga2.init.d.cmake
+++ b/etc/initsystem/icinga2.init.d.cmake
@@ -43,7 +43,9 @@ if [ $? != 0 ]; then
         exit 6
 fi
 
-getent group $ICINGA2_COMMAND_GROUP >/dev/null 2>&1 || echo "Command group '$ICINGA2_COMMAND_GROUP' does not exist. Exiting." && exit 6
+getent passwd $ICINGA2_USER >/dev/null 2>&1 || (echo "Icinga user '$ICINGA2_USER' does not exist. Exiting." && exit 6)
+getent group $ICINGA2_GROUP >/dev/null 2>&1 || (echo "Icinga group '$ICINGA2_GROUP' does not exist. Exiting." && exit 6)
+getent group $ICINGA2_COMMAND_GROUP >/dev/null 2>&1 || (echo "Icinga command group '$ICINGA2_COMMAND_GROUP' does not exist. Exiting." && exit 6)
 
 # Get function from functions library
 if [ -f /etc/rc.d/init.d/functions ]; then



More information about the icinga-checkins mailing list