Bitcoin Forum
May 08, 2024, 04:42:14 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: ubuntu: cgminer as service (/etc/init.d) or as cron  (Read 4323 times)
bitcoinminer42 (OP)
Legendary
*
Offline Offline

Activity: 1904
Merit: 1185


notorious shrimp!


View Profile
April 16, 2013, 09:51:22 PM
 #1

hi there!

i plan to automate my mining rigs.
doeas anyone installed cgminer as a linux sercice?
i have several problems with overclocking of my 7950 cards

other idea is to use cron to automatically start cgminer at system start.

thanks, bcm42
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715186534
Hero Member
*
Offline Offline

Posts: 1715186534

View Profile Personal Message (Offline)

Ignore
1715186534
Reply with quote  #2

1715186534
Report to moderator
1715186534
Hero Member
*
Offline Offline

Posts: 1715186534

View Profile Personal Message (Offline)

Ignore
1715186534
Reply with quote  #2

1715186534
Report to moderator
GoldSeal
Legendary
*
Offline Offline

Activity: 1862
Merit: 1002



View Profile
April 16, 2013, 11:14:09 PM
 #2

do not use cron for anything like that. that's not going to work cleanly.

This is not too difficult. Start cgminer from an init script with --syslog or --sharelog options. The init script should be set to start for run levels 2345. (man update-rc.d on ubuntu for example) You should put any environment variables required to start cgminer into /etc/profile and wrap your cgminer command with:

bash -lc 'cgminer --blah --blah ---blah'

This command ensures that the program is run with a user environment and no TTY.

Another method to set environmental variables is to front load your command with the environment variables you wish to set. I've run into this when using cgminer for litecoin.

Other than that I would suggest using monit to monitor the process  and restart it when it fails. M/Monit is extremely useful as well if you want a web GUI to manage a monit agent.

If you need help with this, I'm planning to assemble a ubuntu based mining rig with 6 cards next week. I can post my init script, monit configs, and other setup details from that install when I do it.

Moving to Puerto Rico...
bitcoinminer42 (OP)
Legendary
*
Offline Offline

Activity: 1904
Merit: 1185


notorious shrimp!


View Profile
April 17, 2013, 07:36:36 AM
 #3

that would be great ;-) thx
slakeco
Newbie
*
Offline Offline

Activity: 48
Merit: 0


View Profile
April 18, 2013, 12:59:49 AM
 #4

I'm planning to assemble a ubuntu based mining rig with 6 cards next week. I can post my init script, monit configs, and other setup details from that install when I do it.

Yes, please +1
GoldSeal
Legendary
*
Offline Offline

Activity: 1862
Merit: 1002



View Profile
April 19, 2013, 07:04:48 PM
 #5

The post is coming by today to drop off my PSU and riser cables. So I should have something for you guys this weekend.

Moving to Puerto Rico...
GoldSeal
Legendary
*
Offline Offline

Activity: 1862
Merit: 1002



View Profile
April 22, 2013, 12:46:37 AM
 #6

I had a miner setback this weekend with an incompatible motherboard. I picked up a new MB, cpu, and mem yesterday. I'm still working on this and should have something posted soon.

Moving to Puerto Rico...
glub0x
Legendary
*
Offline Offline

Activity: 892
Merit: 1013



View Profile
April 22, 2013, 07:55:48 AM
 #7

i spend yesterday evening trying to do this ...
i actually manage to launch a basic .sh script at boot ( mkdir /test ) using the gnome-session startup program

but if instead i put cgminer blahblah it just doesn't work.
I also try init.d folder and rc.local with no more result.


Would be nice if ubuntu just start, then the terminal pop-up and cgminer starts

The cost of mediation increases transaction costs, limiting the
minimum practical transaction size and cutting off the possibility for small casual transactions

Satoshi Nakamoto : https://bitcoin.org/bitcoin.pdf
-ck
Legendary
*
Offline Offline

Activity: 4102
Merit: 1632


Ruu \o/


View Profile WWW
April 22, 2013, 10:55:14 AM
 #8

Launch cgminer via screen

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
glub0x
Legendary
*
Offline Offline

Activity: 892
Merit: 1013



View Profile
April 22, 2013, 05:58:08 PM
 #9

Launch cgminer via screen
sounds like THE solution! i'll give it a try and keep update.

The cost of mediation increases transaction costs, limiting the
minimum practical transaction size and cutting off the possibility for small casual transactions

Satoshi Nakamoto : https://bitcoin.org/bitcoin.pdf
crazyates
Legendary
*
Offline Offline

Activity: 952
Merit: 1000



View Profile
April 22, 2013, 06:42:27 PM
 #10

Launch cgminer via screen
sounds like THE solution! i'll give it a try and keep update.
Someone previously suggested byobu, and that's what I use.

Tips? 1crazy8pMqgwJ7tX7ZPZmyPwFbc6xZKM9
Previous Trade History - Sale Thread
glub0x
Legendary
*
Offline Offline

Activity: 892
Merit: 1013



View Profile
April 22, 2013, 07:44:10 PM
Last edit: April 22, 2013, 08:06:52 PM by glub0x
 #11

Launch cgminer via screen
sounds like THE solution! i'll give it a try and keep update.
Someone previously suggested byobu, and that's what I use.
I ll try that.

I just tried screen and it doesn't do what i want.
If i do  in the terminal
screen sh adress/to/my/script.sh
It does launch the script just like if i type sh adress/to/my/script.sh

Now when i restart the computer it seems to do nothing (not poping a terminal windows with cg miner)...


[EDIT] I finally get what i wanted.
I used this startup.sh script that i put on the desktop
Code:
#!/bin/sh
gnome-terminal -x sh /home/XXX/cgminer/mycgminercommand.sh

then i used the Startup Application utility of Ubuntu and linked to my  startup.sh script


Every time my computer reboot a terminal popup with cgminer inside.

The cost of mediation increases transaction costs, limiting the
minimum practical transaction size and cutting off the possibility for small casual transactions

Satoshi Nakamoto : https://bitcoin.org/bitcoin.pdf
Marrs
Member
**
Offline Offline

Activity: 112
Merit: 10


View Profile
April 22, 2013, 07:46:28 PM
 #12

Launch cgminer via screen
sounds like THE solution! i'll give it a try and keep update.
Someone previously suggested byobu, and that's what I use.
I ll try that.

I just tried screen and it doesn't do what i want.
If i do  in the terminal
screen sh adress/to/my/script.sh
It does launch the script just like if i type sh adress/to/my/script.sh

Now when i restart the computer it seems to do nothing (not poping a terminal windows with cg miner)...



Like this:

Code:
/usr/bin/screen -A -d -m -S cgminer /path/to/cgminer -c /otherpath/to/cgminer.conf --whatever-other-parameters

Then you can bring it to the foreground later using:

Code:
screen -d -r

Then put it back into the background (aka detach) by typing CNTL-a d

GoldSeal
Legendary
*
Offline Offline

Activity: 1862
Merit: 1002



View Profile
April 28, 2013, 01:09:59 AM
 #13

Sorry for the late update. I ended up using a wrapper script which calls mine.sh that sets the environement and launches cgminer.

In xcfe4 I added the wrapper script to the list of items run at startup and configured auto-login on boot. This works fine as long as mine.sh exports display to :0 and you add a 15 sec sleep to the front of the wrapper script. MY cgminer is configured to output to syslog and I load ths data into Splunk. Splunk provides me with email based alerting  and I can make a pretty nice graphical dashboard to monitor the box etc.

Later this week I'll see about getting an init script together to launch the wrapper script with the proper uid, etc. Once that works, I'll configure monitr to restart the service automatically. I'll need a bit more time to do this. I've been busy this week. =)

Moving to Puerto Rico...
Pages: [1]
  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!