and see why it wont exit when done?
I tried with done, exit, exit 0, .... and it stays running in the background
I ran it through beautify and read it. It is basically a stripped down version of 3main. I don't know what your expectations are as far as it exiting, but this code block (same as in 3main) is meant to just run forever:
while [ $BITCOIN == "theGROUND" ]
do
sleep 60
done
So scripts like this and 3main are meant to not "fall out". I am not overly familiar with the screen command but it would appear that the parent process of them is not 3main or as in your case wtm-miner, but rather "/sbin/upstart --user". As such, I am not sure if this infinite loop is required any longer. It may be legacy code before screen was implemented. Give it a go without it in your script and see if the miner continues to run.
Hope this helps.
I hate quoting myself, but here goes. I did a simple test to see if the infinite loop is necessary given the screen command. Try this for yourself:
will launch top in a screen. Then exit the ssh session and login again. You can then resume the top session with the usual screen -r top. So, I don't think that infinite loop in 3main is needed any longer. However, I have not exercised all parts of nvOC but I can tell you for certain that it is not needed after those miners who are launched with screen.
Hope this helps.
Thanks a lot mate.
It was always a question for me what those loops are for...
Tested the miner start script without the loops and all is good.
I think as you said its some legacy code from old nvOC and can be removed.
And as I said before that wtm-miner is just a copy of 3main miner starts so wtm auto switch dont restart 3main which will take so long and just switch miner.
agreed, this code seems redundant... I haven't fully analyzed 3main but the only logic behind it is to stop code below it to execute if the condition was met.
we need to clean and optimize the current code before adding any more features which will make the code even messier than it is now.
while we are on the programming topic... I really can't stand the misuse of logs to pass information/variables between the scripts. not only that the logs slow down everything, they are killing the usb sticks, causing all kinds of problems, hangs, freezes, etc. and i see more and more people are recomanding usage of screenlog
how about using named pipes (fifo) to pass info between the scripts. nothing is saved/logged by using a named pipe and it is much faster. leave the logs for what they were really ment to: to record problems
example: we want to get the fan speed and temps from the temp control so we can send it trough telegram. the easy solution is to write all those values from the temp control script into a log, then read from the log and send telegram. the problem is that in order to satisfy the telegram, the temp script has to write line by line that info for each gpu into a log, 24/7 so that the info is there when telegram needs it.
if we rewrite the temp control to keep sending all that info to a named pipe, the info will be there when telegram needs it without writing to a log over and over, 24/7, and write to a log only critical info/errors that would be needed for troubleshooting
i started rewriting the temp control and i intend to incorporate the named pipes but that will break compatibility with telegrams, web stats, and whatever else is fetching the info from logs. i just can't find enough free time to rewrite all the scripts in nvoc
if interested in the development and optimization of nvoc, please google "bash named pipe" and research then share your thoughts, maybe we can split the workload if you are interested
I'm all the way game with optimizing any codes
I think the best approach on optimizing temp or other codes is whomever write, test and optimized it, send it to fullzero and other devs to optimize other codes with it before releasing new version with it