[Pacemaker] wchih user's path is called from getenv("PATH")/external.c

Junko IKEDA tsukishima.ha at gmail.com
Mon Aug 15 10:22:23 CET 2011


Hi,

I am trying to setup external/ipmi configuration,
and binary path for ipmi is "/tmp/impi", for example.

I added its path in "/etc/profile",
# grep tmp /etc/profile
PATH=$PATH:/tmp

and PATH for root user is the following(including "/tmp").
# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/tmp:/root/bin

but it seemed that impi plugin could not find its new binary path,
so I added some debug messages like this;

--- external.c.org      2011-08-15 17:54:02.000000000 +0900
+++ external.c  2011-08-15 17:53:08.000000000 +0900
@@ -754,11 +754,13 @@ external_run_cmd(struct pluginDevice *sd

        /* external plugins need path to ha_log.sh */
        path = getenv("PATH");
+               LOG(PIL_INFO, "----- current path %s", path);
        if (strncmp(GLUE_SHARED_DIR,path,strlen(GLUE_SHARED_DIR))) {
                new_path_len = strlen(path)+strlen(GLUE_SHARED_DIR)+2;
                new_path = (char *)g_malloc(new_path_len);
                snprintf(new_path, new_path_len, "%s:%s",
GLUE_SHARED_DIR, path);
                setenv("PATH", new_path, 1);
+               LOG(PIL_INFO, "----- new path %s", new_path);
                g_free(new_path);
        }


--- /usr/lib64/stonith/plugins/external/ipmi.org        2011-08-15
18:12:08.000000000 +0900
+++ /usr/lib64/stonith/plugins/external/ipmi    2011-08-15
17:58:50.000000000 +0900
@@ -94,6 +94,8 @@ do_ipmi() {
                ha_log.sh debug "ipmitool output: `echo $outp`"
                return 0
        else
+               ha_log.sh err "PATH=`echo $PATH`"
+               ha_log.sh err "USER=`echo $USER`"
                ha_log.sh err "error executing ipmitool: `echo $outp`"
                return 1
        fi


/var/log/ha-log said;
Aug 15 17:59:12 bl460g1n13 stonithd: [6722]: info: ----- current path
/sbin:/usr/sbin:/bin:/usr/bin
Aug 15 17:59:12 bl460g1n13 stonithd: [6722]: info: ----- new path
/usr/share/cluster-glue:/sbin:/usr/sbin:/bin:/usr/bin
Aug 15 17:59:12 bl460g1n13 stonithd: [6802]: info: ----- current path
/usr/share/cluster-glue:/sbin:/usr/sbin:/bin:/usr/bin
Aug 15 17:59:53 bl460g1n13 external/ipmi[6803]: ERROR:
PATH=/usr/share/cluster-glue:/sbin:/usr/sbin:/bin:/usr/bin
Aug 15 17:59:53 bl460g1n13 external/ipmi[6803]: ERROR: USER=
Aug 15 17:59:53 bl460g1n13 external/ipmi[6803]: ERROR: error executing
ipmitool: Error: Unable to establish IPMI v2 / RMCP+ session^M Unable
to get Chassis Power Status^M

Which user's path is called here?
or how can I setup the specific path for ipmi?

Best Regards,
Junko IKEDA

NTT DATA INTELLILINK CORPORATION
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hb_report.tar.bz2
Type: application/x-bzip2
Size: 21301 bytes
Desc: not available
URL: <http://oss.clusterlabs.org/pipermail/pacemaker/attachments/20110815/121c4f54/attachment-0001.bz2>


More information about the Pacemaker mailing list