Skip to content

Commit

Permalink
Fix: libcrmcommon: export logfile environment variable if using default
Browse files Browse the repository at this point in the history
When not explicitly specifying a log, Pacemaker before 2.0.0 would set the
logfile environment variables when checking the corosync configuration for
logging options. Since Pacemaker 2 does not use corosync's logging options
anymore, this step was skipped. However, some resource agents relied on the
environment variables to enable logging, so this introduced a regression.

This fixes it by exporting the default log name when (successfully) used.
  • Loading branch information
kgaillot committed May 30, 2019
1 parent c34003d commit c94063f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/common/logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ crm_add_logfile(const char *filename)
if(is_default) {
default_fd = fd;

// Some resource agents will log only if environment variable is set
if (daemon_option("logfile") == NULL) {
set_daemon_option("logfile", filename);
}

} else if(default_fd >= 0) {
crm_notice("Switching to %s", filename);
qb_log_ctl(default_fd, QB_LOG_CONF_ENABLED, QB_FALSE);
Expand Down

0 comments on commit c94063f

Please sign in to comment.