I am trying to run a command from within my MythTV interface on my Mythbuntu computer.
It won't run, and I found this error in my mythbackend.log:
Jul 19 15:55:47 mythbuntu mythbackend[1863]: W SystemEvent mythsystemevent.cpp:55 (run) MythSystemEventHandler: Command '/bin/sh /home/mythbuntu/Buttons/powerbutton.sh' returned 127
I looked up what returned 127 means on Google, and it seems to mean simply "command not found".
But, /bin is on my path...
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/mythbuntu/Buttons:/home/mythbuntu
... and sh is definitely in there:
$ ls /bin/sh
/bin/sh
So why is this command not being found?
set +xat the beginning of powerbutton.sh. This will cause the shell to print every line of the script as it's executed. That way, you can watch it and hopefully see what's going on. If your calling script is also a shell script, you can try the same thing with it, too. Or, if it's in another language, try running it in a debugger so you can see what's going on. – Scott Severance Jul 28 '12 at 22:30