Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Commit

Permalink
core: avoid writing objects.cache if set to /dev/null
Browse files Browse the repository at this point in the history
refs #3819
  • Loading branch information
Michael Friedrich committed Mar 10, 2013
1 parent ac68d22 commit cadff24
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Changelog
Expand Up @@ -24,6 +24,7 @@ ENHANCEMENTS
* core: enhance illegal macro character processing performance (Andreas Ericsson) #3389 - MF
* core: add the notification type by string to debug logs; set CUSTOM=8, STALKING=9 (Andreas Ericsson) #3818 - MF
* core: skip writing status.dat if explicitely set to /dev/null (e.g. when using alternate data retrieval methods like IDOUtils) (Andreas Ericsson) #3819 - MF
* core: avoid writing objects.cache if set to /dev/null (Andreas Ericsson) #3819 - MF

* classic ui: Add "set_expire_ack_by_default" to cgi configuration #3476 - CF
* classic ui: Add "send_ack_notifications" to cgi configuration (TheCry) #3467 - CF
Expand Down Expand Up @@ -87,6 +88,7 @@ CHANGES

* icinga.cfg - enable_state_based_escalation_ranges=0 (disabled if not set) fix for #3441
* icinga.cfg - set status_file=/dev/null to disable its creation #3819
* icinga.cfg - set object_cache_file=/dev/null to disable its creation #3819

* core: -v param can be used more than once #3510
* core: 'Warning: Host ... has no service associated with it!' now happens only in icinga -vv icinga.cfg #3510
Expand Down
4 changes: 4 additions & 0 deletions sample-config/icinga.cfg.in
Expand Up @@ -71,6 +71,10 @@ cfg_dir=@sysconfdir@/modules
# this cache file (rather than looking at the object config files
# directly) in order to prevent inconsistencies that can occur
# when the config files are modified after Icinga starts.
# If you explicitely set it to /dev/null the core will skip writing
# the objects cache file entirely.
# Tip: Use that file to debug your configuration with fully resolved
# objects like the core sees them.

object_cache_file=@STATEDIR@/objects.cache

Expand Down
3 changes: 3 additions & 0 deletions xdata/xodtemplate.c
Expand Up @@ -10489,6 +10489,9 @@ int xodtemplate_cache_objects(char *cache_file) {
time_t current_time = 0L;
void *ptr = NULL;

/* skip if set to /dev/null */
if (!cache_file || !strcmp(cache_file, "/dev/null"))
return OK;

time(&current_time);

Expand Down

0 comments on commit cadff24

Please sign in to comment.