mirror of
				https://github.com/Icinga/icinga2.git
				synced 2025-10-31 19:24:25 +01:00 
			
		
		
		
	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:
		
						commit
						0f570e8fe9
					
				| @ -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/) | 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). | 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> | ## Upgrading the MySQL database <a id="upgrading-mysql-db"></a> | ||||||
| 
 | 
 | ||||||
| If you're upgrading an existing Icinga 2 instance, you should check the | If you're upgrading an existing Icinga 2 instance, you should check the | ||||||
|  | |||||||
| @ -52,6 +52,10 @@ if type restorecon >/dev/null 2>&1; then | |||||||
| fi | fi | ||||||
| chmod 2750 $ICINGA2_RUN_DIR/icinga2/cmd | 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 | mkdir -p $ICINGA2_CACHE_DIR | ||||||
| chown $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_CACHE_DIR | chown $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_CACHE_DIR | ||||||
| chmod 750 $ICINGA2_CACHE_DIR | chmod 750 $ICINGA2_CACHE_DIR | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user