File pacemaker-lrmd-verbosity-options-handled-after-crm_log_init.patch of Package pacemaker.8397
commit c0ddb31cd04837216e36768f027cc1b1b3ac95a3
Author: Andrew Beekhof <andrew@beekhof.net>
Date: Fri May 5 18:02:32 2017 +1000
lrmd: Ensure verbosity options are handled after crm_log_init()
Index: pacemaker-1.1.16+20170320.77ea74d/lrmd/main.c
===================================================================
--- pacemaker-1.1.16+20170320.77ea74d.orig/lrmd/main.c
+++ pacemaker-1.1.16+20170320.77ea74d/lrmd/main.c
@@ -529,6 +529,7 @@ main(int argc, char **argv, char **envp)
{
int flag = 0;
int index = 0;
+ int bump_log_num = 0;
const char *option = NULL;
/* If necessary, create PID1 now before any FDs are opened */
@@ -557,7 +558,7 @@ main(int argc, char **argv, char **envp)
crm_add_logfile(optarg);
break;
case 'V':
- crm_bump_log_level(argc, argv);
+ bump_log_num++;
break;
case '?':
case '$':
@@ -571,6 +572,11 @@ main(int argc, char **argv, char **envp)
crm_log_init(NULL, LOG_INFO, TRUE, FALSE, argc, argv, FALSE);
+ while (bump_log_num > 0) {
+ crm_bump_log_level(argc, argv);
+ bump_log_num--;
+ }
+
option = daemon_option("logfacility");
if(option && safe_str_neq(option, "none")) {
setenv("HA_LOGFACILITY", option, 1); /* Used by the ocf_log/ha_log OCF macro */