This is really great stuff kjj, thanks so much for saving me the time. On wednesday night I should be able to implement this. Can you explain to me the last code? the crontab -e
the restart script just kills the terminal and restarts it if the cpu load falls a certain amount?
have you found a way to monitor them remotely?
crontab -e is the command to edit the user crontab. You need to run that command, which starts an editor, so you can add that line. Must be done while logged in as
user not as
root, as in use LXTerminal from the Accessories menu, not Root Terminal.
The restart script checks for two possible error conditions. First, if the script named miner1.sh (or miner2.sh, or minerX.sh) is no longer running. Second, if the load on the appropriate GPU is too low, which usually means that the script is hung and no longer asking for work, but still running. If either condition is true, it attempts to kill the script if still running, and then starts it in a way that it pops up on the display and has access to X.
For remote monitoring, I'm using some custom mods to cdhowie's flexible mining proxy. My proxy box has a cron script that pulls the database every few minutes, and if any miner hasn't requested work in a certain amount of time, a command is sent to a networked power strip to cut power for a few seconds, rebooting the box regardless of how badly crashed it is.
These scripts are still pretty crude, but they work great for me. Hopefully you and others will find them useful as well.
I'm planning two improvements, but I probably won't get around to them until late in the week. First, I want to create config files to simplify setup, particularly for people that don't already know how to customize these bash scripts. And once that is done, I want to set it up to download the config files from a webserver so that I can just clone the USB stick to plug into a new box and have automatic provisioning.