Author

Topic: Linux "screen" question with cgminer (Read 4763 times)

full member
Activity: 200
Merit: 100
|Quantum|World's First Cloud Management Platform
February 07, 2012, 06:15:31 PM
#7
Thanks for the info. I did attempt to redirect output of cgminer to a log file, but that did not work (it just logged the first xhost message and nothing after that). I would also just want it to log the exit stats anyway, not everything, as I am trying to minimize IO as much as possible since this is a USB stick (I already changed the disk scheduler method and mounted tmp to use RAM). I will try it again and see if it works, however. The default scrollback buffer size of 100 lines should be more than enough for cgminer's exit stats, I would think. Basically, everything above the current terminal screen (which is only 24 lines high) is cut off. I will change the buffer size but I suspect it isn't going to fix this particular problem.
sr. member
Activity: 445
Merit: 250
February 07, 2012, 03:14:56 AM
#6
As to the screen scrollback issue, see ...
That's really helpful! I'm such a basic screen user, I never realised there was so much more  Grin
member
Activity: 266
Merit: 36
February 06, 2012, 09:36:39 PM
#5
Tested and it works, except the cgminer exit statistics lines above the top of the terminal get cut off and scrolling up doesn't help (it just shows the last prompt when I typed screen -r), so I can't see the entire stats printout.

First, another answer to your original post:  you can log cgminer's output to a file.  Here is the relevant portion of the script that I use to start cgminer:
Code:
#!/bin/bash
now="`date +%Y.%m.%d.%H.%M.%S`"
cd ~/miners/cgminer
DISPLAY=:0 cgminer -c cgminer.conf 2> logs/$now.log

It causes a log file with date and time as part of the file name to get cgminer's output.

As to the screen scrollback issue, see GNU Screen: Working with the Scrollback Buffer
full member
Activity: 200
Merit: 100
|Quantum|World's First Cloud Management Platform
February 06, 2012, 12:58:01 PM
#4
Tested and it works, except the cgminer exit statistics lines above the top of the terminal get cut off and scrolling up doesn't help (it just shows the last prompt when I typed screen -r), so I can't see the entire stats printout.
full member
Activity: 200
Merit: 100
|Quantum|World's First Cloud Management Platform
February 06, 2012, 03:17:51 AM
#3
Cool, I'll give it a try and see if it works.
sr. member
Activity: 445
Merit: 250
February 06, 2012, 02:10:27 AM
#2
In my bash script, I have
Code:
screen -d -m -S miner
which starts screen & gives it a name ("miner")
and
Code:
screen -X -S miner screen -t x1 1
screen -X -S miner -p 1 stuff "cgminer -c cgminep
"
which adds a screen (called x1, with the index 1) to the screen called "miner" (like "ctrl-a c") and invokes cgminer (using config file 'cgminep') in it. You know the newline between 'cgminep' and ' " ' is deliberate, right?

Then I just
Code:
screen -r
and there it is.

Hope it helps.
full member
Activity: 200
Merit: 100
|Quantum|World's First Cloud Management Platform
February 06, 2012, 01:52:43 AM
#1
I have cgminer set to start in a bash script which calls the program "screen" to do so. This works great except the very useful stats printout cgminer gives when exiting is lost since that instance of "screen" terminates. I'm sure there's a trivial way to either log this output when cgminer exits, or a command that can be sent to screen to have that "screen" instance remain displayed on the terminal when exiting cgminer? I'm still fairly green with linux and my searches and reading the man page have come up empty thus far.
Jump to: