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 15 minutes 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/ and don’t forget to add execute permissions using chmod +x /home/ethos/

The cron job can be created like this:

cat << EOF | sudo tee /etc/cron.d/rigcheck
*/15 * * * *   root    /home/ethos/

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.

14 replies on “Auto-restart crashed mining processes in ethOS 1.2.7”

  1. Hello,
    do I have to install root to ethos? just getting a warning no to install using apt-get. would appretiate if you give some info how to create the cron job. I already made the sh file. thank you

  2. hello, when i add cronjob, i’ve always got error 0: bad minute errors in the crontab file, can’t install. Could you help me, is there any errors that i made? Thank you

    cat << EOF | sudo tee /etc/cron.d/rigcheck
    0 /12 * * * root /home/ethos/

    1. Primoz, the script requires modification in 1.2.9. In 1.2.9, the status changes to active as soon as the hashrate is > 0. In earlier versions, the active state was signaled only after all mining process were started.
      However, there’s a new state that indicates if one or more GPU have been crashed, so we might use this new state to trigger the process restart instead.

  3. 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 file that’s provided, should this work? I’m not sure if it is or not…, otherwise how do I create the 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.

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


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

        1. Niko if you find a solution please post it here. There will be others with the same question, I am sure.

      2. I am in the same boat as Niko Bhagwandin, new to Linux and ethOS but determined to learn. That attitude is frankly why a lot of people shy away from these operating systems. Is there any reason you or someone else couldn’t just help him out?

Comments are closed.