Merge pull request #5601 from Icinga/fix/empty-cache-dir-on-pkg-upgrade

Ensure that the cache directory always is set and add a note to upgrading docs
This commit is contained in:
Michael Friedrich 2017-09-22 09:43:20 +02:00 committed by GitHub
commit 0f570e8fe9
2 changed files with 20 additions and 0 deletions

View 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

View 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