Hi, I'm having a hard time executing a very small bash script that needs to call `yum` in my Splunk app. The script is written in bash, and attempts to execute the following command:
yum check-update | grep 'x86_64\|noarch' | wc -l
I can run the command (and whole bash script) successfully from my ssh session, but execution by Splunk fails, since `/opt/splunk/bin/splunk` sets custom `PYTHONHOME` and `PYTHONPATH`, which point to `/opt/splunk` (Splunk comes with its own distribution of Python). Thus, even though `/usr/bin/yum` is itself a Python script which calls `/usr/bin/python2.7` explicitly, it fails to load `yum` Python module.
I tried setting custom `PYTHONHOME` and `PYTHONPATH`, tried pointing them to `/usr/`, tried pointing them explicitly to whatever my system `sys.path` lists, but the script always fails.
Did anyone encounter a similar problem and/or has an idea how to fix this?
↧