Blob Blame History Raw
commit 20d6b6e542b9814b081355ed19874f75445b0901
Author: Andrew Beekhof <andrew@beekhof.net>
Date:   Tue Apr 8 15:44:00 2014 +1000

    Fix: lrmd: Expose logging variables expected by OCF agents
    
    (cherry picked from commit fa8bd56b776b97c3c845986d084c01b4aaf4063c)

diff --git a/lrmd/main.c b/lrmd/main.c
index 38c5466..8e00f11 100644
--- a/lrmd/main.c
+++ b/lrmd/main.c
@@ -246,6 +246,7 @@ main(int argc, char **argv)
     int rc = 0;
     int flag = 0;
     int index = 0;
+    const char *option = NULL;
 
 #ifdef ENABLE_PCMK_REMOTE
     crm_log_init("pacemaker_remoted", LOG_INFO, TRUE, FALSE, argc, argv, FALSE);
@@ -282,6 +283,20 @@ main(int argc, char **argv)
         }
     }
 
+    option = daemon_option("logfacility");
+    if(safe_str_neq(option, "none")) {
+        setenv("HA_LOGFACILITY", option, 1);  /* Used by the ocf_log/ha_log OCF macro */
+    }
+
+    option = daemon_option("logfile");
+    if(safe_str_neq(option, "none")) {
+        setenv("HA_LOGFILE", option, 1);      /* Used by the ocf_log/ha_log OCF macro */
+
+        if (daemon_option_enabled(crm_system_name, "debug")) {
+            setenv("HA_DEBUGLOG", option, 1); /* Used by the ocf_log/ha_debug OCF macro */
+        }
+    }
+
     /* Used by RAs - Leave owned by root */
     crm_build_path(CRM_RSCTMP_DIR, 0755);