Quantcast
Channel: Questions in topic: "splunk-enterprise"
Viewing all articles
Browse latest Browse all 47296

Executing scripts that depend on Python scripts

$
0
0
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?

Viewing all articles
Browse latest Browse all 47296

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>