set(ICINGA2_USER "icinga" CACHE STRING "Icinga 2 user")
set(ICINGA2_GROUP "icinga" CACHE STRING "Icinga 2 group")
-set(ICINGA2_COMMAND_USER "icinga" CACHE STRING "Icinga 2 command user")
set(ICINGA2_COMMAND_GROUP "icingacmd" CACHE STRING "Icinga 2 command group")
set(ICINGA2_RUNDIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/run" CACHE STRING "/run directory")
set(ICINGA2_PLUGINDIR "/usr/lib/nagios/plugins" CACHE STRING "Path for the check plugins")
- `ICINGA2_USER`: The user Icinga 2 should run as; defaults to `icinga`
- `ICINGA2_GROUP`: The group Icinga 2 should run as; defaults to `icinga`
-- `ICINGA2_COMMAND_USER`: The command user Icinga 2 should use; defaults to `icinga`
- `ICINGA2_GIT_VERSION_INFO`: Whether to use Git to determine the version number; defaults to `ON`
- `ICINGA2_COMMAND_GROUP`: The command group Icinga 2 should use; defaults to `icingacmd`
- `ICINGA2_UNITY_BUILD`: Whether to perform a unity build
# default settings for icinga2's initscript
#DAEMON_CONFIG="/etc/icinga2/icinga2.conf"
-#DAEMON_USER=nagios
-#DAEMON_GROUP=nagios
#DAEMON_CMDGROUP=www-data
#DAEMON_ARGS="-e /var/log/icinga2/icinga2.err"
DESC="icinga2 monitoring daemon"
NAME=icinga2
DAEMON=/usr/sbin/icinga2
-DAEMON_USER=nagios
-DAEMON_GROUP=nagios
DAEMON_CMDGROUP=www-data
DAEMON_ARGS="-e /var/log/icinga2/icinga2.err"
STARTUP_LOG="/var/log/icinga2/startup.log"
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
+DAEMON_USER=`$DAEMON variable get --current RunAsUser`
+DAEMON_GROUP=`$DAEMON variable get --current RunAsGroup`
+
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-DICINGA2_RUNDIR=/run \
-DICINGA2_USER=nagios \
-DICINGA2_GROUP=nagios \
- -DICINGA2_COMMAND_USER=nagios \
-DICINGA2_COMMAND_GROUP=www-data \
-DICINGA2_PLUGINDIR=/usr/lib/nagios/plugins \
-DICINGA2_UNITY_BUILD=TRUE
exit 1
fi
+ICINGA2_USER=`$DAEMON variable get --current RunAsUser`
+ICINGA2_GROUP=`$DAEMON variable get --current RunAsGroup`
+
mkdir -p $(dirname -- $ICINGA2_PID_FILE)
chown $ICINGA2_USER:$ICINGA2_GROUP $(dirname -- $ICINGA2_PID_FILE)
if [ -f $ICINGA2_PID_FILE ]; then
test -x $DAEMON || exit 5
+ICINGA2_USER=`$DAEMON variable get --current RunAsUser`
+ICINGA2_GROUP=`$DAEMON variable get --current RunAsGroup`
+
if [ ! -e $ICINGA2_CONFIG_FILE ]; then
echo "Config file '$ICINGA2_CONFIG_FILE' does not exist."
exit 6
ICINGA2_LOG=@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/icinga2.log
ICINGA2_USER=@ICINGA2_USER@
ICINGA2_GROUP=@ICINGA2_GROUP@
-ICINGA2_COMMAND_USER=@ICINGA2_COMMAND_USER@
ICINGA2_COMMAND_GROUP=@ICINGA2_COMMAND_GROUP@
-DICINGA2_RUNDIR=%{_rundir} \
-DICINGA2_USER=%{icinga_user} \
-DICINGA2_GROUP=%{icinga_group} \
- -DICINGA2_COMMAND_USER=%{icinga_user} \
-DICINGA2_COMMAND_GROUP=%{icingacmd_group} \
-DICINGA2_UNITY_BUILD=TRUE"
%if "%{_vendor}" == "redhat"