Author

Topic: KNC Miners - auto restart script (Read 2341 times)

sr. member
Activity: 476
Merit: 250
let's have some fun
October 16, 2013, 04:43:57 PM
#10
I have a $5 tip for someone who gives me working script to reboot my jupiter every so many hours. Obviously it has to be run at startup and survive reboot. I have it on .91 with the reboot mod added.  Thanks

It would be a bonus if it could detect ghs drop for x seconds then reboot as well.

you'd be better off running the reboot.cgi URL web command from a remote computer on a looped script for that.

and since it would be driven from a remote machine, it would be possible to read the value off your pool's page and then do some type of stop limit type trigger for it

I'm not much of a web coder but I've seen stuff like this in action.  probably not hard for those into that

Good idea.

btw:
there's a nice tool/firefox plugin used for web-testing you can use with nearly zero knowledge about programming.
for reloading the status page and clicking the restart-btn in case of crash, this will do the job for you I guess
Not sure about checking a value on one page and trigger an action based on it on another webpage (check pool restart miner).
http://docs.seleniumhq.org/projects/ide/
sr. member
Activity: 476
Merit: 250
let's have some fun
October 16, 2013, 04:24:36 PM
#9
I ran your 1st script btc_uzr got this
sh cgrestart.sh
cgrestart.sh: line 9: syntax error: unexpected "done" (expecting "then")
[1]+  Done(127)                  bash cgrestart.sh

I assume you ran it on your desktop pc or similar, since the script executes fine on my KnCMiner; tested a min ago

On KnC devices there's no bash but sh.
/bin/sh -> /bin/busybox

and for example Ubuntu links it to dash
/bin/sh -> dash




sr. member
Activity: 462
Merit: 250
October 16, 2013, 11:44:09 AM
#8
I have a $5 tip for someone who gives me working script to reboot my jupiter every so many hours. Obviously it has to be run at startup and survive reboot. I have it on .91 with the reboot mod added.  Thanks

It would be a bonus if it could detect ghs drop for x seconds then reboot as well.

you'd be better off running the reboot.cgi URL web command from a remote computer on a looped script for that.

and since it would be driven from a remote machine, it would be possible to read the value off your pool's page and then do some type of stop limit type trigger for it

I'm not much of a web coder but I've seen stuff like this in action.  probably not hard for those into that
newbie
Activity: 28
Merit: 0
October 16, 2013, 06:15:17 AM
#7
I have a $5 tip for someone who gives me working script to reboot my jupiter every so many hours. Obviously it has to be run at startup and survive reboot. I have it on .91 with the reboot mod added.  Thanks

It would be a bonus if it could detect ghs drop for x seconds then reboot as well.
newbie
Activity: 28
Merit: 0
October 15, 2013, 10:56:34 PM
#6
I ran your 1st script btc_uzr got this
sh cgrestart.sh
cgrestart.sh: line 9: syntax error: unexpected "done" (expecting "then")
[1]+  Done(127)                  bash cgrestart.sh
newbie
Activity: 28
Merit: 0
October 15, 2013, 09:16:28 PM
#5
Just restarting CGminer every so often is not bringing it back to life, it quickly loses ghs after 30min and disturbs so many cores it doesn't help. I need an auto reboot mechanism. What I need is a similar script in the init startup to reboot every 2 hours.

If anyone has suggestions
newbie
Activity: 28
Merit: 0
October 15, 2013, 06:20:14 PM
#4
BUMP, this got lost in the mix there.

I'll try to play with this a bit and let you know.
sr. member
Activity: 462
Merit: 250
October 14, 2013, 12:34:02 PM
#3
nice,

I think the best way to mimic .93 would be to monitor your pool's reading of Gh and have it restart after the avg stays below a certain limit for 3 or 5 checks in a row
Or perhaps watch cgminer's Gh and HW errors & WU and make up a suitable floor for doing the same

I know Kano has a calculation that takes all this and gives an estimate of what 'paid hashing' your miner is really doing

I am currently gaining about 40Gh more on avg just by restarting every 2 1/2 hours.. of course if a miner doesn't have issues recovering cores on its own this isn't needed
sr. member
Activity: 476
Merit: 250
let's have some fun
October 14, 2013, 11:59:46 AM
#2
restart only in case of a crash

Code:
#!/bin/sh
while true
do
       if [ "$(pidof cgminer)" == "" ]
       then
           sh /etc/init.d/cgminer.sh restart
       fi
       sleep 10;
done


frequent restart as well as restart in case of a crash

Code:
#!/bin/sh
time=0;
restartIntervall=100; #seconds
while true
do
       if [ "$(pidof cgminer)" == "" ] || [ $(($time - $restartIntervall)) -eq 0 ]
       then
           sh /etc/init.d/cgminer.sh restart
           time=0;
       fi
       sleep 10;
       time=$(($time+10));
done

-both untested-
sr. member
Activity: 462
Merit: 250
October 14, 2013, 11:29:47 AM
#1
A few of us have noticed that .93 will restart cgminer a fair bit when performance dips and enjoyed the better overall avg hashing
Since the other firmwares seem to not care and since there is no crontab installed....I wrote a simple shell script to auto-restart every X seconds

Place it in your /bin dir so not to care about paths, and keep a copy in your /config dir since reboots of the miner will overwrite a lot of files

I named mine tripminer.sh


#!/bin/sh
while true
do
       sh /etc/init.d/cgminer.sh restart
       sleep 9200
done


9200 seconds is about 2 1/2 hours. Change it to whatever you like.

if this helps you, a few bits in the tipjar would be nice    1Ki3sFg6bCasB6tkuMW41DCCpGFDgDHVgL


Jump to: