Auto-restart crashed mining processes in ethOS 1.2.7

I have been running a crypto-currency mining rig on the Linux based ethOS distro for quite some time now. While I realize that ethOS is problematic license-wise, it’s still a great distro to get a mining rig up and running in almost no time. The Nvidia GPUs in my rig are well tuned to operate at their optimum cost/hashrate ratio. However, due to bugs in the miner and/or the GPU drivers, every few days one of the GPUs stops mining. Sometimes ethOS is able to recover the GPU and gets it back to mining but sometimes it doesn’t seem to detect the crashed/hanging mining process at all. This is why I added a cron job that runs every minute and checks if all GPUs are still mining. If not, the miners will be re started using the minestop and minestart commands provided by ethOS.

The cron job starts the Bash script below. If it detects a problem, it writes to the console and additionally to /tmp/rigcheck.log. It’s been running smoothly on my ethOS v1.2.7 mining rig. I recommend putting it in /home/ethos/rigcheck.sh and don’t forget to add execute permissions using chmod +x /home/ethos/rigcheck.sh

The cron job can be created like this:

cat << EOF | sudo tee /etc/cron.d/rigcheck
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
* * * * *   root    /home/ethos/rigcheck.sh
EOF

Thanks to this script, crashed or hanging miners will be restarted fairly quickly and my rig’s pool-reported hashrate stopped dropping in such situations.

7 thoughts on “Auto-restart crashed mining processes in ethOS 1.2.7

  1. Hello, I’m new to linux, and been mining on ethOS for only a couple weeks. I’m a little confused on how to actually implement this code. I’ve put it in the custom.sh file that’s provided, should this work? I’m not sure if it is or not…, otherwise how do I create the rigcheck.sh file?
    Also, whats the bit about the cron job? I’ve sent those commands through the LXterminal, but idk what it does, or is supose to do…
    Also, the chmod bit about exit permissions, is this a one time thing? or do I need to send this command upon a fresh boot?

    Please excuse my novice questions, any explanation will be greatly appreciated.

    • Niko, that’s not where the script should go. My advice is to stay away from ethOS customisation unless you have some Linux experience.

      Cheers,
      Jan

      • I appreciate your advice, but I’m determined to learn, if you are not willing to help me out I’ll find other sources.

Leave a Reply

Your email address will not be published. Required fields are marked *