Pages:
Author

Topic: [Solved] Help Restarting Miners in Linuxcoin (Read 3590 times)

newbie
Activity: 42
Merit: 0
Glad I could help, sent in PM
hero member
Activity: 711
Merit: 500
http://forum.bitcoin.org/index.php?topic=29021.0

Just add xhost+  and the other line to startminers or autostart script
full member
Activity: 135
Merit: 100
@ Reckman

Do you mind posting the complete correct script, for the newbies?

full member
Activity: 154
Merit: 100
Added this to my start miner script, seemed to do the trick, this is now working correctly

xhost +
echo $DISPLAY > /home/user/.display

Karmee + Xtriphammer post addresses for donations

Sent to you in a PM.

Code:
xhost +
echo $DISPLAY > /home/user/.display

Duh... Forgot about xhost... I just assumed those two would be already persistent in the environment.

Keep those miners mining!

Cheers,
Kermee
hero member
Activity: 711
Merit: 500
Added this to my start miner script, seemed to do the trick, this is now working correctly

xhost +
echo $DISPLAY > /home/user/.display

Karmee + Xtriphammer post addresses for donations
hero member
Activity: 711
Merit: 500
Will try that when I get home kermee, I feel the minerX.sh script is fine, because the start.sh script calls them, and they load the miners fine, also upping the bounty to 1btc, I did not anticipate it would be this difficult to fix.

@gopher, that seems like an inefficient solution, the restart script cycles every minute

@triphammer, no I followed this guide http://forum.bitcoin.org/index.php?topic=29021.0
full member
Activity: 135
Merit: 100

I would like to take a bit different approach to this. I just posted a detailed step-by-step guide on howto mine in linuxcoin headless. In a variation of the startminers.sh script, I would propose using timed loop to restart all phoenix.py processes once every 24 hrs.

Will this work for you?

Code:

#!/bin/bash

while true

cd /opt/miners/phoenix/

./phoenix.py -u http://aaNcBG:[email protected]:8080 -k poclbm DEVICE=0 BFI_INT VECTORS AGGRESSION=8 &

sleep 2

./phoenix.py -u http://gxPrZG:[email protected]:8080 -k poclbm DEVICE=1 BFI_INT VECTORS AGGRESSION=8 &

sleep 2

./phoenix.py -u http://FBpQqd:[email protected]:8080 -k poclbm DEVICE=2 BFI_INT VECTORS AGGRESSION=8 &

sleep 2

./phoenix.py -u http://PfyxvQ:[email protected]:8080 -k poclbm DEVICE=3 BFI_INT VECTORS AGGRESSION=8

sleep 86400

killall phoenix.py

done



full member
Activity: 154
Merit: 100
with one miner off


user@linuxcoin:~$ ps -ef | grep phoenix.py | grep -v grep
user      4685  4684  0 03:24 pts/2    00:00:03 /usr/bin/python ./phoenix.py -u http://[email protected]_bottom:[email protected]:8332/ -q 7 -k phatk BFI_INT VECTORS FASTLOOP=false AGGRESSION=11 DEVICE=1
user      4687  4686  0 03:24 pts/3    00:00:03 /usr/bin/python ./phoenix.py -u http://[email protected]_bottom:[email protected]:8332/ -q 7 -k phatk BFI_INT VECTORS FASTLOOP=false AGGRESSION=11 DEVICE=2
user@linuxcoin:~$ ps -ef | grep phoenix.py | grep -v grep| wc -l
2
user@linuxcoin:~$


Hrm. This is strange.

Change miner0.sh to this:

Code:
cd /opt/miners/phoenix && /opt/miners/phoenix/phoenix.py -u http://[email protected]_bottom:[email protected]:8332/ -q 7 -k phatk BFI_INT VECTORS FASTLOOP=false AGGRESSION=7 DEVICE=0

Kill miner0, and then manually run the script by calling:

Code:
/home/user/miner1.sh

And tell me what happens... I think 'restart.sh' is fine... It's your minerX.sh scripts which are the problem.

Cheers,
Kermee

newbie
Activity: 42
Merit: 0
Correct me if I'm wrong, but you also have the auto.sh file that runs after boot?

Code:
#!/bin/bash

xhost +
echo $DISPLAY > /home/user/.display
lxterminal --command "/usr/local/bin/startminers.sh"

I think this might help Kermee debug the problem, I'm having it too, whenever I've seen xhost + used it is usually always after an

Code:
export DISPLAY=:0
hero member
Activity: 711
Merit: 500
with one miner off


user@linuxcoin:~$ ps -ef | grep phoenix.py | grep -v grep
user      4685  4684  0 03:24 pts/2    00:00:03 /usr/bin/python ./phoenix.py -u http://[email protected]_bottom:[email protected]:8332/ -q 7 -k phatk BFI_INT VECTORS FASTLOOP=false AGGRESSION=11 DEVICE=1
user      4687  4686  0 03:24 pts/3    00:00:03 /usr/bin/python ./phoenix.py -u http://[email protected]_bottom:[email protected]:8332/ -q 7 -k phatk BFI_INT VECTORS FASTLOOP=false AGGRESSION=11 DEVICE=2
user@linuxcoin:~$ ps -ef | grep phoenix.py | grep -v grep| wc -l
2
user@linuxcoin:~$
full member
Activity: 154
Merit: 100
Run this just to make sure:

Code:
ps -ef | grep phoenix.py | grep -v grep

Or you can just do a line-count:

Code:
ps -ef | grep phoenix.py | grep -v grep | wc -l

You should get an output of '3'... Which means 3 phoenix.py miners are running.

Cheers,
Kermee
hero member
Activity: 711
Merit: 500
Ran it Once with all miners running, then restart.sh, then closed a miner and repeated.  Thanks for you help, really appreciate it.


Code:
user@linuxcoin:~$ ps -ef | grep X | grep -v grep
root      4286  4278 14 03:21 tty7     00:00:05 /usr/bin/X :0 -audit 0 -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt7
user      4326  4278  0 03:21 ?        00:00:00 /usr/bin/lxsession -s LXDE -e LXDE
user      4378  4326  1 03:21 ?        00:00:00 lxpanel --profile LXDE
user      4380  4326  1 03:21 ?        00:00:00 pcmanfm --desktop --profile LXDE
user@linuxcoin:~$ sh  /home/user/restart.sh
user@linuxcoin:~$ sh  /home/user/restart.sh
kill: 9: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]

(lxterminal:4566): Gtk-WARNING **: cannot open display:
user@linuxcoin:~$
(lxterminal:4581): Gtk-WARNING **: cannot open display:

user@linuxcoin:~$ ps -ef | grep X | grep -v grep
root      4286  4278 11 03:21 tty7     00:00:06 /usr/bin/X :0 -audit 0 -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt7
user      4326  4278  0 03:21 ?        00:00:00 /usr/bin/lxsession -s LXDE -e LXDE
user      4378  4326  1 03:21 ?        00:00:00 lxpanel --profile LXDE
user      4380  4326  0 03:21 ?        00:00:00 pcmanfm --desktop --profile LXDE
user@linuxcoin:~$
full member
Activity: 154
Merit: 100
How do i check on X server? could i start it with the script?

Code:
ps -ef | grep X | grep -v grep

Tell me what the output is.

Cheers,
Kermee
hero member
Activity: 711
Merit: 500
How do i check on X server? could i start it with the script?

Sorry im linux newb. Still getting similar output, below with one miner turned off

Code:
user@linuxcoin:~$ sh  /home/user/restart.sh
kill: 9: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]

(lxterminal:4169): Gtk-WARNING **: cannot open display:

Run this for me to:

Code:
`cat /home/user/.display`

Since I just noticed you have an export DISPLAY on it...

Cheers,
Kermee

ran this, no output...restart.sh still giving same output
full member
Activity: 154
Merit: 100
Run this for me to:

Code:
`cat /home/user/.display`

Since I just noticed you have an export DISPLAY on it...

Cheers,
Kermee
full member
Activity: 154
Merit: 100
Change each minerX.sh to (of course incrementing DEVICE=0 through 2) this:

Code:
#!/bin/bash
cd /opt/miners/phoenix && ./phoenix.py -u http://[email protected]_bottom:[email protected]:8332/ -q 7 -k phatk BFI_INT VECTORS FASTLOOP=false AGGRESSION=7 DEVICE=0

Your restart.sh should look like this:

Code:
#!/bin/bash
export DISPLAY=`cat /home/user/.display`
pc=`ps waxuf | grep miner1.sh -c`
ld=`DISPLAY=:0 aticonfig --odgc --adapter=0 | grep "GPU load" | cut -c 30-35 | cut -d % -f 1`
if [ $pc -lt "2" ] || [ $ld -lt "50" ] ; then
 kill `ps -ef | grep miner1 | grep -v grep | awk '{print $2}'`
 lxterminal --title miner1 --command sh /home/user/miner1.sh &
 date +"%D %r miner1 restarted" >> /home/user/cron_job.log
fi
pc=`ps waxuf | grep miner2.sh -c`
ld=`DISPLAY=:0 aticonfig --odgc --adapter=1 | grep "GPU load" | cut -c 30-35 | cut -d % -f 1`
if [ $pc -lt "2" ] || [ $ld -lt "50" ] ; then
 kill `ps -ef | grep miner2 | grep -v grep | awk '{print $2}'`
 lxterminal --title miner2 --command sh /home/user/miner2.sh &
 date +"%D %r miner2 restarted" >> /home/user/cron_job.log
fi
pc=`ps waxuf | grep miner3.sh -c`
ld=`DISPLAY=:0 aticonfig --odgc --adapter=2 | grep "GPU load" | cut -c 30-35 | cut -d % -f 1`
if [ $pc -lt "2" ] || [ $ld -lt "50" ] ; then
 kill `ps -ef | grep miner3 | grep -v grep | awk '{print $2}'`
 lxterminal --title miner3 --command sh /home/user/miner3.sh &
 date +"%D %r miner3 restarted" >> /home/user/cron_job.log
fi

If the 'DISPLAY=:0' isn't fixing this:

Code:
(lxterminal:XXXX): Gtk-WARNING **: cannot open display:
aticonfig: This program must be run as root when no X server is active

Double-check to make sure that X is running. X might of crashed...

Cheers,
Kermee

hero member
Activity: 711
Merit: 500
Code:
#!/bin/bash
cd /opt/miners/phoenix
./phoenix.py -u http://[email protected]_bottom:[email protected]:8332/ -q 7 -k phatk BFI_INT VECTORS FASTLOOP=false AGGRESSION=7 DEVICE=0

The bootup script calls these shell files, and they work fine, opening each miner in a sep terminal named after the miner
full member
Activity: 154
Merit: 100
Paste the contents of /home/user/miner1.sh for me.   You can remove the pool info, creds, etc.

Cheers,
Kermee
hero member
Activity: 711
Merit: 500
Yes 3 cards, 3 miners

Its not restarting the miners though...applied your changes fixed the cron job error...but still broke Smiley

It is logging that it restarts the miners

Code:
user@linuxcoin:~$ sh  /home/user/restart.sh
kill: 9: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]

(lxterminal:3919): Gtk-WARNING **: cannot open display:
aticonfig: This program must be run as root when no X server is active
kill: 16: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]

(lxterminal:3934): Gtk-WARNING **: cannot open display:
aticonfig: This program must be run as root when no X server is active
kill: 23: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]
user@linuxcoin:~$
(lxterminal:3949): Gtk-WARNING **: cannot open display:

full member
Activity: 154
Merit: 100
I can give you a general idea:

1. Put 'DISPLAY=:0' in front of all of your 'aticonfig' commands. Example:

Code:
ld=`aticonfig --odgc --adapter=0 | grep "GPU load" | cut -c 30-35 | cut -d % -f 1`

Should be:

Code:
ld=`DISPLAY=:0 aticonfig --odgc --adapter=0 | grep "GPU load" | cut -c 30-35 | cut -d % -f 1`

2. This error:

Code:
/home/user/restart.sh: 9: cannot create /home/user/cron_job.log: Permission denied

Is probably occurring since it looks like you ran it as 'root' once so cron_job.log is owned by 'root' now.  You can fix it by running:

Code:
sudo chown user /home/user/cron_job.log

3. This error:
Code:
kill: 9: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]

Actually looks right if it's not finding one of your miner's running since the output of the awk from ps -ef would be empty.  You're calling it 3 times.  Do you really have 3 miners in your rig? -- If you do and still see that error, it's probably fine.  That can occur if a miner is already 'turned' off.

Cheers,
Kermee
Pages:
Jump to: