[Pacemaker] Every line produced with ocf_log is written twice

Grüninger, Andreas (LGL Extern) Andreas.Grueninger at lgl.bwl.de
Wed Sep 26 18:19:50 CEST 2012


Pacemaker 1.1.8 (Build: bdd3f2e):  ncurses libqb-logging libqb-ipc lha-fencing upstart systemd  heartbeat corosync-native snmp libesmtp
resource-agents  3.9.3.113-a796f3-dirty

I use in a resource script the logging facility with ocf_log.
Every line produced with ocf_log is written twice. 
I checked with logging to_syslog enabled and disabled.

from corosync.conf
....
logging {
   fileline: on
   function_name: on
   to_stderr: on
   to_logfile: on
   to_syslog: off
   syslog_facility: local6
   logfile: /opt/ha/var/log/corosync.log
   debug: off
   logfile_priority: error
   syslog_priority: error
   tags: enter|leave|trace
   timestamp: on
}
....

from syslog:
....
Sep 26 08:39:20 [8670]       crmd:     info: te_rsc_command:    Initiating action 5: stop zone_zd-sol-s25_stop_0 on zd-sol-s1
Sep 26 08:39:26 [8670]       crmd:     info: te_rsc_command:    Initiating action 6: start zone_zd-sol-s25_start_0 on zd-sol-s2 (local)
zpool(zone_zd-sol-s25)[848]:    2012/09/26_08:39:26 INFO: zpool pool1 apparently exported
zpool(zone_zd-sol-s25)[848]:    2012/09/26_08:39:26 INFO: zpool pool1 apparently exported
zpool(zone_zd-sol-s25)[848]:    2012/09/26_08:39:36 INFO: zpool pool1 imported
zpool(zone_zd-sol-s25)[848]:    2012/09/26_08:39:36 INFO: zpool pool1 imported
zpool(zone_zd-sol-s25)[848]:    2012/09/26_08:39:47 INFO: zone zd-sol-s25 booted
zpool(zone_zd-sol-s25)[848]:    2012/09/26_08:39:47 INFO: zone zd-sol-s25 booted
Sep 26 08:39:48 [8670]       crmd:     info: services_os_action_execute:        Managed zpool_meta-data_0 process 1928 exited with rc=0
Sep 26 08:39:48 [8670]       crmd:   notice: process_lrm_event:         LRM operation zone_zd-sol-s25_start_0 (call=855, rc=0, cib-update=617, confirmed=true) ok
....

Excerpt from script:
.....
zpool_start() {
        zpool_monitor; rc=$?
        if [ $rc = $OCF_SUCCESS ]; then
                ocf_log err "zpool ${OCF_RESKEY_state} already running."
                return $OCF_ERR_GENERIC
        fi
        if [ $rc = $OCF_NOT_RUNNING ]; then
                ocf_log info "zpool ${OCF_RESKEY_zpoolname} apparently exported"
      sudo zpool import ${OCF_RESKEY_zpoolname}; rc=$?
      if [ $rc != $OCF_SUCCESS ]; then
         ocf_log err "zpool import ${OCF_RESKEY_zpoolname} returns ${rc}"
         return $OCF_ERR_GENERIC
      fi
      sudo touch ${OCF_RESKEY_state}
      zpool_monitor; rc=$?
      if [ $rc != $OCF_SUCCESS ]; then
         ocf_log err "monitor returns ${rc}"
         return $OCF_ERR_GENERIC
      else
         ocf_log info "zpool ${OCF_RESKEY_zpoolname} imported"
.....


Andreas



More information about the Pacemaker mailing list