Bitcoin Forum
April 23, 2024, 08:16:03 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: poclbm autostart on Ubuntu 10.10? (30 BTC)  (Read 11225 times)
Mahkul
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250


Every saint has a past. Every sinner has a future.


View Profile
February 28, 2011, 03:18:18 PM
 #21

Why is it looking for that file in the /.bitcoin/ directory and not in ~/.bitcoin/ (where it acutally is)

Because it doesn't know that you as a user even exists.
Try setting HOME to your directory.

Quote
Should LD_LIBRARY_PATH and DISPLAY=:0 lines be in the rc.local itself? Because I have them in my automine script:

It won't hurt but it should be working within the miner (but try both)

What happens if you run this script as root but not in autostart?

I have a very similar script that works in autostart. 

Ha! It didn't work as root, but I changed the line in rc.local to:

Code:

sudo -i -u mahkul /home/mahkul/automine


Works like a charm.  Cool
1713903363
Hero Member
*
Offline Offline

Posts: 1713903363

View Profile Personal Message (Offline)

Ignore
1713903363
Reply with quote  #2

1713903363
Report to moderator
The forum strives to allow free discussion of any ideas. All policies are built around this principle. This doesn't mean you can post garbage, though: posts should actually contain ideas, and these ideas should be argued reasonably.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Fractality (OP)
Newbie
*
Offline Offline

Activity: 47
Merit: 0



View Profile WWW
February 28, 2011, 05:39:42 PM
 #22

Quote
What happens if you run the script without redirecting to the log files, i.e. without >/home/bjoern/bitcoin/poclbm1.log .

First nothing (no output, no command prompt). If I quit via ctrl+c, and then do ps -a | grep poclbm, it shows a running poclbm process. Somehow I can not kill that one, either (not even with sudo kill -9), how is that? Is that because it belongs to the script? How could I kill it?

Should I see the output from poclbm, or is it swallowed by the script?

Quote
/home/mahkul/Downloads/bitcoin-0.3.19/bin/32/bitcoind >> /home/mahkul/log/bitcoind.log 2>&1 &

Just curious, what does the 2>&1 part at the end of the line do?
Mahkul
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250


Every saint has a past. Every sinner has a future.


View Profile
February 28, 2011, 05:56:52 PM
 #23

Quote
/home/mahkul/Downloads/bitcoin-0.3.19/bin/32/bitcoind >> /home/mahkul/log/bitcoind.log 2>&1 &

Just curious, what does the 2>&1 part at the end of the line do?

The 2>&1 will write standard output and standard errors to a file. While it is processing, the command line will not be available. The shell will wait for the process to complete before letting you enter anything into the command line again.

The 2>&1 & will also write standard output and standard errors to a file. The extra & means to execute the process in the background so the command line is still available while it is processing.
Raulo
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
February 28, 2011, 06:21:52 PM
 #24

First nothing (no output, no command prompt). If I quit via ctrl+c, and then do ps -a | grep poclbm, it shows a running poclbm process. Somehow I can not kill that one, either (not even with sudo kill -9), how is that? Is that because it belongs to the script? How could I kill it?

If you cannot kill a process, it means that the fglrx driver messed in kernel memory. I had such behavior only when I overclocked too much. It should not happen.

Check if there is a kernel panic in /var/log/messages and look for any problems in /var/log/Xorg.0.log

1HAoJag4C3XtAmQJAhE9FTAAJWFcrvpdLM
Fractality (OP)
Newbie
*
Offline Offline

Activity: 47
Merit: 0



View Profile WWW
February 28, 2011, 06:30:35 PM
 #25

Thanks - I now have the script working via ssh (adding the "&" after the line helped, I guess). However, starting it from rc.local it seems the graphics card once again is not visible.

Running it with "sudo myscript" in rc.local works. But is there a way to make it not run as root?
Fractality (OP)
Newbie
*
Offline Offline

Activity: 47
Merit: 0



View Profile WWW
February 28, 2011, 06:44:36 PM
Last edit: February 28, 2011, 06:55:53 PM by Fractality
 #26

Hm, correction - I just rebooted again and it didn't work with sudo. Could it be a random chance, depending on something else already being started or not?

Update: hm, odd, it didn't work wenn I added the -r 60 parameter to poclbm. With -r 10 it works atm.
Fractality (OP)
Newbie
*
Offline Offline

Activity: 47
Merit: 0



View Profile WWW
March 03, 2011, 11:24:20 PM
 #27

Only got round to testing again today. Now even with -r 10 it was random if autostart would succeed or not. I added a sleep 60 command to the startup script, hopefully that should take care of race conditions.
Grinder
Legendary
*
Offline Offline

Activity: 1284
Merit: 1001


View Profile
March 04, 2011, 08:57:15 AM
 #28

You can try making a file called /etc/rc5.d/S50bcminer and putting the commands in it. Make sure it is executable (chmod +x /etc/rc5.d/S50bcminer). The GPU miners require the X-server, but it is only started when the computer reaches run level 5. rc.local is executed at run level 3. Putting it in rc5.d with that name makes sure the script isn't run until the server has started and everything else has been loaded. The S50 part is there because the files are executed in sorted order, the rest (bcminer) you can change to whatever you want.
dmp1ce
Member
**
Offline Offline

Activity: 69
Merit: 10


View Profile WWW
April 09, 2011, 07:40:14 PM
 #29

Another thing you can do is to put the commands into cron so that the applications will keep trying to start if they get closed for whatever reason.

I had to write a script to check if poclbm was already running and then run it if it wasn't.

Code:
#!/bin/bash
# poclbm-start.sh

# This script needs to be run as root for me

# Make sure LD_LIBRARY_PATH is available
export LD_LIBRARY_PATH=/opt/ati-stream-sdk-v2.1-lnx64/lib/x86_64/

# Look to see if poclbm is already running
if [[ $(ps -ef) =~ "python poclbm.py -d $1" ]]; then
  echo "A program with the same command already seems to be running according to 'ps -ef'"
else
  # poclbm not running so start it.
  echo "Starting python poclbm.py -d $1 -o yourbitcoindhost -w 128 --pass=pass --user=user --verbose"
  cd /yourpoclbmdirectory
  python poclbm.py -d $1 -o yourbitcoindhost -w 128 --pass=pass --user=user --verbose >> /yourlogdirectory/poclbm-$1.log 2>&1 &
fi

Then I added this to my root cron configuration:

Code:
* * * * * /scriptlocation/poclbm-start.sh 1
* * * * * /scriptlocation/poclbm-start.sh 2
* * * * * /scriptlocation/poclbm-start.sh 3
* * * * * /scriptlocation/poclbm-start.sh 4


BTCmon - Support great bitcoin apps
Zamicol
Newbie
*
Offline Offline

Activity: 56
Merit: 0



View Profile
April 20, 2011, 12:43:18 AM
 #30


Code:
export DISPLAY=:0
export LD_LIBRARY_PATH=/path/to/sdk:$LD_LIBRARY_PATH
pocmldir/poclbm.py --parametes

Put the script is some file and  run it from /etc/rc.local


I'm a noob to scripting so I don't understand all of this.  I want to be able to press the power button on a machine with no other peripherals (monitor/keyboard) and have it start up and start mining.  I have my machine auto-log in, so I don't think I need to worry about the SDK configuration, but I don't quite understand how to get poclbm autostarting:

-"Put the script is some file"  Huh? 
-"and  run it from /etc/rc.local" Huh again?

I'm also using the Ati over clock utility that uses QT, is there any way to set the default gpu/mem speeds?

Thanks!
Zamicol
Newbie
*
Offline Offline

Activity: 56
Merit: 0



View Profile
April 20, 2011, 06:39:10 AM
Last edit: April 20, 2011, 08:27:13 PM by Zamicol
 #31

 Cheesy I figured it out  Cheesy
Now I will share my knowledge for all future generations.  

First set a user to auto log in.
System->Administration->Login screen

Next, make a simple shell script. It needs to be something that will work under the terminal.  Example:
Code:
#!/bin/sh
cd /home/zamicol/Bitcoin/poclbm
python poclbm.py -u ******** --pass=********** -o ************* -p 8332 -d 1 -v -w 128

You can make this using a text editor like gedit.  Save it with the .sh extension.  Example: "myBitcoinMiner.sh"

Make your script executable.  (Right click->Properties->Permissions->Execute).  You should now be able to double click your script and have it run under terminal to verify that your script works.  

Now to have it start up automatically upon login.  Go to System->Preferences->Startup Application.  On the screen that appears, click "Add"

Name it whatever you want.  Under the command, type "gnome-terminal -x /home/zamicol/Bitcoin/myBitcoinMiner.sh" and replace that latter part with the path to to script that you made.  The -x will put your command in a new terminal window upon startup.  

You should have a system now that will start up and start mining without any further input from you  Grin  Good luck!

And in case anyone ever feels generous, my address is below.


Zamicol
Newbie
*
Offline Offline

Activity: 56
Merit: 0



View Profile
April 20, 2011, 06:52:04 AM
 #32


Fanspeed, no: resets after each X restart to auto.  Clock, yes:
Code:
aticonfig --odcc --adapter=all


I type that in and it says "Clocks persisted for Adapter 0 - ATI Radeon HD 5800 Series."  When I reboot, the clocks are the same.  What am I missing?

BTW, you're the man, Raulo. 
Raulo
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
April 20, 2011, 06:55:48 AM
 #33


Fanspeed, no: resets after each X restart to auto.  Clock, yes:
Code:
aticonfig --odcc --adapter=all

I type that in and it says "Clocks persisted for Adapter 0 - ATI Radeon HD 5800 Series."  When I reboot, the clocks are the same.  What am I missing?


It makes the clocks set before and printed by
Code:
aticonfig --odgc --adapter=all
permanent, also after reboot.

1HAoJag4C3XtAmQJAhE9FTAAJWFcrvpdLM
Zamicol
Newbie
*
Offline Offline

Activity: 56
Merit: 0



View Profile
April 20, 2011, 10:53:27 PM
 #34

 
It makes the clocks set before and printed by
Code:
aticonfig --odgc --adapter=all
permanent, also after reboot.

You're still the man, but I have difficulty deciphering your manner of speech... but I was able to accomplish setting the default clock/mem speeds using default profiles in AMDOverdiveCtrl and setting it to start at login. 
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!