Post
Topic
Board Hardware
Merits 1 from 1 user
Re: GekkoScience has a new stickminer that does 300+GH
by
nullama
on 22/06/2022, 00:35:25 UTC
⭐ Merited by Sledge0001 (1)
Okay so I got CGMiner to run at startup on a Pi 4 although I can't seem to actually see it in the terminal it on the pi!  Cheesy

Here is what I added this to the /etc/rc.local  

Code:
cd /home/pi/git/vthoang/cgminer

sudo ./cgminer -o stratum+tcp://solo.ckpool.org:3333 -u BTCADD.PI1 -p x --gekko-compacf-freq 570 --gekko-start-freq 420 --suggest-diff 128

I see the stats on the pool side but have no idea how to actually view what's running in the usual CGMiner terminal window!

ctrl-alt-f1 does show me the terminal window but its not displayed as it would be if I just entered the commands in terminal.

Any suggestions?


Do you need it to be run as sudo?, it's generally not a good idea.

If you want to see the actual output from the console you can call the script with screen, which allows you to detach the process and attach to it from anywhere later on.

Easiest thing would be to create a bash script(let's call it start_cgminer.sh) that does the actual call to cgminer(use absolute paths, not just ./cgminer), then call that instead on /etc/rc.local:

Code:
screen -dm -S miner  /home/pi/git/vthoang/cgminer/start_cgminer.sh

That will be executed as root, so no need to do sudo. The arguments just mean it starts on the background and names it miner. To attach to that screen, just do:

Code:
screen -r miner

You'll now see the usual output.

To exit, just press Ctrl-A, and then Ctrl-D. That is, hold Control, press A. Then release everything. Then hold Control, press D. That will detach the process, and you can come back again as usual.

If you want to run the process as another user instead of root, you can do so with this command instead(let's use pi as the user):

Code:
su - pi -c "screen -dm -S miner  /home/pi/git/vthoang/cgminer/start_cgminer.sh"

And finally, to check if you have any scripts running in the background, you can simply do:

Code:
screen -list