From e83c43435dd45d958882e4a32ba75e27bab51034 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Sat, 1 Jul 2017 13:59:58 +0200 Subject: [PATCH] Ensure the cache directory exists As suggested in https://github.com/Icinga/icinga2/issues/4414 --- etc/initsystem/icinga2.sysconfig.cmake | 1 + etc/initsystem/prepare-dirs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/etc/initsystem/icinga2.sysconfig.cmake b/etc/initsystem/icinga2.sysconfig.cmake index 646347d19..e7fa54baf 100644 --- a/etc/initsystem/icinga2.sysconfig.cmake +++ b/etc/initsystem/icinga2.sysconfig.cmake @@ -6,6 +6,7 @@ ICINGA2_PID_FILE=$ICINGA2_RUN_DIR/icinga2/icinga2.pid ICINGA2_ERROR_LOG=@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/error.log ICINGA2_STARTUP_LOG=@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/startup.log ICINGA2_LOG=@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/icinga2.log +ICINGA2_CACHE_DIR=$ICINGA2_STATE_DIR/cache/icinga2 ICINGA2_USER=@ICINGA2_USER@ ICINGA2_GROUP=@ICINGA2_GROUP@ ICINGA2_COMMAND_GROUP=@ICINGA2_COMMAND_GROUP@ diff --git a/etc/initsystem/prepare-dirs b/etc/initsystem/prepare-dirs index 6c4a08869..cb6ddbec0 100644 --- a/etc/initsystem/prepare-dirs +++ b/etc/initsystem/prepare-dirs @@ -51,3 +51,7 @@ if type restorecon >/dev/null 2>&1; then restorecon -R $ICINGA2_RUN_DIR/icinga2/ fi chmod 2750 $ICINGA2_RUN_DIR/icinga2/cmd + +mkdir -p $ICINGA2_CACHE_DIR +chown $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_CACHE_DIR +chmod 750 $ICINGA2_CACHE_DIR