]> granicus.if.org Git - icinga2/commitdiff
Ensure that the cache directory always is set and add a note to upgrading docs 5601/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Fri, 22 Sep 2017 07:31:05 +0000 (09:31 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Fri, 22 Sep 2017 07:31:42 +0000 (09:31 +0200)
Thanks @dgoetz

doc/16-upgrading-icinga-2.md
etc/initsystem/prepare-dirs

index edbe9b0b9c986124e05d86195ceeb4d5d6ddc32e..5c22f2b4309c55d9638c6b1893ac431d08c1396c 100644 (file)
@@ -24,6 +24,22 @@ In case are having troubles with OpenSSL 1.1.0 and the
 public CA certificates, please read [this advisory](https://www.icinga.com/2017/08/30/advisory-for-ssl-problems-with-leading-zeros-on-openssl-1-1-0/)
 and check the [troubleshooting chapter](15-troubleshooting.md#troubleshooting).
 
+If Icinga 2 fails to start with an empty reference to `$ICINGA2_CACHE_DIR`
+ensure to set it inside `/etc/sysconfig/icinga2` (RHEL) or `/etc/default/icinga2` (Debian).
+
+RPM packages will put a file called `/etc/sysconfig/icinga2.rpmnew`
+if you have modified the original file.
+
+Example on CentOS 7:
+
+```
+vim /etc/sysconfig/icinga2
+
+ICINGA2_CACHE_DIR=/var/cache/icinga2
+
+systemctl restart icinga2
+```
+
 ## Upgrading the MySQL database <a id="upgrading-mysql-db"></a>
 
 If you're upgrading an existing Icinga 2 instance, you should check the
index cb6ddbec0f8f8fa36cbacad80bf68bc942531584..5d67d476d73f00a688c8a67fb8a37da3ef7583d1 100644 (file)
@@ -52,6 +52,10 @@ if type restorecon >/dev/null 2>&1; then
 fi
 chmod 2750 $ICINGA2_RUN_DIR/icinga2/cmd
 
+# Add a fallback if the user did not specify this directory in the sysconfig file
+if [ -z "$ICINGA2_CACHE_DIR" ]; then
+       ICINGA2_CACHE_DIR=$ICINGA2_STATE_DIR/cache/icinga2
+fi
 mkdir -p $ICINGA2_CACHE_DIR
 chown $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_CACHE_DIR
 chmod 750 $ICINGA2_CACHE_DIR