1 2 Previous Next 28 Replies Latest reply on Sep 2, 2016 10:40 AM by S Crawford

    nexec command path being set incorrectly on linux hosts

    richard mcleod

      I have a linux server running the 8.6 agent, from BSA (windows hosts) I am executing a type-1 NSH script against the linux server. I've been trying to debug why the NSH script is failing to run yum with the proper dependencies (python, etc...) I found that the linux server is inheriting the Windows Path variable when the NSH script is executed.

       

      In the script I am running

       

      nexec -e env|grep PATH

       

      This returns

       

      Info02/03/2015 12:04:37LD_LIBRARY_PATH=/opt/bmc/bladelogic/RSCD/lib PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/bmc/bladelogic/RSCD/bin:/opt/bmc/bladelogic/RSCD/sbin
      Info02/03/2015 12:04:37/cygdrive/C/Program Files/BMC Software/BladeLogic/NSH/bin:/cygdrive/C/Program Files/BMC Software/BladeLogic/NSH/sbin:/cygdrive/C/Program Files/BMC Software/BladeLogic/NSH/bin:/cygdrive/C/Program Files/BMC Software/BladeLogic/NSH/sbin:/cygdrive/C/Program Files/BMC Software/BladeLogic/NSH/bin:/cygdrive/C/Program Files/BMC Software/BladeLogic/NSH/sbin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Windows/System32/Windows System Resource Manager/bin:/cygdrive/c/Program Files/HP/HP BTO Software/bin:/cygdrive/c/Program Files/HP/HP BTO Software/bin/win64:/cygdrive/c/Program Files/HP/HP BTO Software/bin/win64/OpC:/usr/bin:/jre/bin

       

      If I RDP to the appserver host where this was executed, open NSH, I can see that the PATH variable is set like this:

       

      path=('/cygdrive/C/Program Files/BMC Software/BladeLogic/NSH/bin' '/cygdrive/C/Program Files/BMC Software/BladeLogic/NSH/sbin' /cygdrive/c/Windows/system32 /cygdrive/c/Windows /cygdrive/c/Windows/System32/Wbem /cygdrive/c/Windows/System32/W

      indowsPowerShell/v1.0 '/cygdrive/c/Windows/System32/Windows System Resource Manager/bin' '/cygdrive/c/Program Files/HP/HP BTO Software/bin' '/cygdrive/c/Program Files/HP/HP BTO Software/bin/win64' '/cygdrive/c/Program Files/HP/HP BTO Software/bin/win64/OpC' /usr/bin /cygdrive/c/opscode/chef/bin)

       

      If I use nexec from my server against the target linux host I am not seeing the PATH issue.

       

      (12:16:51) linuxbox://linuxbox| nexec -e env | grep PATH

      LD_LIBRARY_PATH=/opt/bmc/bladelogic/RSCD/lib

      PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/bmc/bladelogic/RSCD/bin:/opt/bmc/bladelogic/RSCD/sbin

       

      I am using nexec because I am capturing the output and then testing for strings.

       

      Any idea how to fix this?

        1 2 Previous Next