custom.sh problems (again!)
Since new update, this function appears to be broken again... :(
I have recalbox pointing to a a usb3 drive as the main drive. On it, under shares/system, I have the script "custom.sh":
#!/bin/bash echo "Starting Cutom.sh" recallog "Starting FANCONTROL" python fanControl.py
fanControl.py runs a fan script.
if I explore the log, it shows that it IS automatically running the script:
[ 21.95] Starting S94manager [ 22.14] ... Starting manager v2 [ 22.39] Starting pm2 [ 844.02] Starting FANCONTROL [ 939.45] Starting FANCONTROL [ 969.53] Stopping Emulationstation [ 969.53] Stopping Emulationstation
However, the fan doesn't run.
If I putty in and run via:
it does run!
So - what's going on here!?
updated my script to:
#!/bin/bash echo "Starting Cutom.sh" recallog "Starting FANCONTROL" recallog "Current Directory: " recallog $PWD /usr/bin/python /recalbox/share/system/fanControl.py
Still no joy. :(
Weird log, though:
[ 22.45] ... Starting manager v2
[ 22.66] Starting pm2
[ 106.81] Starting FANCONTROL
[ 106.83] Current Directory:
[ 106.85] /recalbox/share/system
[ 157.25] Starting FANCONTROL
[ 157.28] Current Directory:
[ 157.37] /recalbox/share/system
[ 179.70] Starting FANCONTROL
[ 179.72] Current Directory:
[ 179.74] /
[ 6.91] No need to upgrade configuration files
@Substring - hey fella - you helped with this last time - any ideas?
Sorry to bump my own post, but desperately trying to get this recalbox setup so I can post it this weekend to a friend who lives in France for xmas!
nemmind. Sussed it:
#!/bin/bash echo "Starting Cutom.sh" recallog "Custom.sh called" case "$1" in start) recallog "Start detected. Starting fan script" /usr/bin/python /recalbox/share/system/fanControl.py ;; stop) recallog "Stop detected." ;; restart|reload) recallog "Restart|Reload detected" ;; *) recallog "Other state detected..." esac exit $?
@stigzler if the recallog works fine but bot the python script, i'd have a look at the script
On the other hand if your customs.sh works on commandline, looks line an environment problem.
Anyway, you should a annampersand & at the end oh hour python command line, no need to hold init because of your script
thanks @Substring , but the most recent code appears to work fine. NOt sure what you mean about the ampersand, but hopefully won't need it as so far so good!
@stigzler I mean
/usr/bin/python /recalbox/share/system/fanControl.py &so that the process goes to background in multiprocessing. Otherwise you just lock the init script and never give the hand back.
What is your python script ? you should, for debug, run your script in custom.sh like
/usr/bin/python /recalbox/share/system/fanControl.py 2>&1 | recallog &and see what the recalbox.log mentions