diff --git a/etc/initsystem/prepare-dirs.cmake b/etc/initsystem/prepare-dirs.cmake index b7e3b6422..d9b644b7a 100644 --- a/etc/initsystem/prepare-dirs.cmake +++ b/etc/initsystem/prepare-dirs.cmake @@ -3,9 +3,13 @@ # This script prepares directories and files needed for running Icinga2 # -# With sysvinit we need to pass the environment this way. Or do we? +# Load sysconf on systems where the initsystem does not pass the environment if [ "$1" != "" ]; then - source "$1" + if [ -r "$1" ]; then + source "$1" + else + echo "Unable to read sysconf from '$1'. Exiting." && exit 6 + fi fi # Set defaults, to overwrite see "@ICINGA2_SYSCONFIGFILE@" diff --git a/etc/initsystem/safe-reload.cmake b/etc/initsystem/safe-reload.cmake index 967e37268..44b261eae 100644 --- a/etc/initsystem/safe-reload.cmake +++ b/etc/initsystem/safe-reload.cmake @@ -1,8 +1,12 @@ #!/bin/sh -# With sysvinit we need to pass the environment this way. Or do we? +# Load sysconf on systems where the initsystem does not pass the environment if [ "$1" != "" ]; then - source "$1" + if [ -r "$1" ]; then + source "$1" + else + echo "Unable to read sysconf from '$1'. Exiting." && exit 6 + fi fi # Set defaults, to overwrite see "@ICINGA2_SYSCONFIGFILE@"