]> granicus.if.org Git - icinga2/commitdiff
Fix sysconfig not bein handled correctly by sysvinit
authorJean Flach <jean-marcel.flach@icinga.com>
Fri, 15 Jun 2018 15:04:28 +0000 (17:04 +0200)
committerJean Flach <jean-marcel.flach@icinga.com>
Fri, 15 Jun 2018 15:04:28 +0000 (17:04 +0200)
etc/initsystem/icinga2.init.d.cmake
etc/initsystem/prepare-dirs.cmake
etc/initsystem/safe-reload.cmake

index 03c88a632cbb174e0ac5a116bae7a74d26e7a3e3..c37977f57479ea36ed3ba8eafb7405b2c5a80fab 100644 (file)
@@ -60,7 +60,7 @@ fi
 # Start Icinga 2
 start() {
        printf "Starting Icinga 2: "
-       @CMAKE_INSTALL_PREFIX@/lib/icinga2/prepare-dirs
+       @CMAKE_INSTALL_PREFIX@/lib/icinga2/prepare-dirs "$SYSCONFIGFILE"
 
        if ! $DAEMON daemon -c $ICINGA2_CONFIG_FILE -d -e $ICINGA2_ERROR_LOG > $ICINGA2_STARTUP_LOG 2>&1; then
                echo "Error starting Icinga. Check '$ICINGA2_STARTUP_LOG' for details."
@@ -105,7 +105,7 @@ stop() {
 
 # Reload Icinga 2
 reload() {
-       exec @CMAKE_INSTALL_PREFIX@/lib/icinga2/safe-reload $SYSCONFIGFILE
+       exec @CMAKE_INSTALL_PREFIX@/lib/icinga2/safe-reload "$SYSCONFIGFILE"
 }
 
 # Check the Icinga 2 configuration
index 2a6c4a262cc29745fe9ffbda74840550908e1be9..b7e3b64227cb0115f82798b74367f9634572110c 100644 (file)
@@ -3,6 +3,11 @@
 # This script prepares directories and files needed for running Icinga2
 #
 
+# With sysvinit we need to pass the environment this way. Or do we?
+if [ "$1" != "" ]; then
+       source "$1"
+fi
+
 # Set defaults, to overwrite see "@ICINGA2_SYSCONFIGFILE@"
 
 : ${ICINGA2_USER:="@ICINGA2_USER@"}
index 57e10b1aca358413a18a1c1b0a08ae33d22a3fce..967e37268eabc7aa3412e243f77805fb1fb12c54 100644 (file)
@@ -1,5 +1,12 @@
 #!/bin/sh
 
+# With sysvinit we need to pass the environment this way. Or do we?
+if [ "$1" != "" ]; then
+       source "$1"
+fi
+
+# Set defaults, to overwrite see "@ICINGA2_SYSCONFIGFILE@"
+
 : ${ICINGA2_PID_FILE:="@ICINGA2_RUNDIR@/icinga2/icinga2.pid"}
 : ${DAEMON:="@CMAKE_INSTALL_FULL_SBINDIR@/icinga2"}