From: Gunnar Beutner Date: Wed, 26 Nov 2014 05:40:24 +0000 (+0100) Subject: Fix the init script X-Git-Tag: v2.3.0~607 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f0e0aac869b2ca7c7b9e438eb6cb4414cbf0978;p=icinga2 Fix the init script refs #7613 --- diff --git a/etc/initsystem/icinga2-prepare-dirs b/etc/initsystem/icinga2-prepare-dirs index 245f065f9..5317da766 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 4ec65e486..c47419322 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