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

Junko IKEDA tsukishima.ha at gmail.com
Tue Aug 16 10:12:46 UTC 2011


Hi,

> The plugins path is fixed. You cannot have more than one. I'm not
> sure, but it could be that it's possible to have subdirectories,
> sth like external/mystuff/ipmi.

sorry, my explanation was not clear.
I want to use the specify "ipmitool" command, like /tmp/ipmitool not
/usr/bin/ipmitool.
external/ipmi get it as `which ipmitool`,
so I tried to add its path in root user's path,
but it was ignored.

Thanks,
Junko

>
> Thanks,
>
> Dejan
>
>> 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
>
>
>> _______________________________________________
>> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
>> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>>
>> Project Home: http://www.clusterlabs.org
>> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>> Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
>
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
>




More information about the Pacemaker mailing list