LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-18-2005, 10:20 AM   #1
purelithium
Member
 
Registered: Oct 2005
Location: Canada
Distribution: Mandriva 2006.0
Posts: 390

Rep: Reputation: 30
BOINC as a service to start at boot


I want to have BOINC start when I boot my machine where would i have to put reference to the boinc shell script for it to do this? I mean I want this to start even before the x server starts. so if i'm not logged in, it can still run.

the path to my boinc file is

/home/gelan/pgms/BOINC/

do I have to put a symlink somewhere?

I'm really not sure how to go about this.
 
Old 11-18-2005, 11:58 AM   #2
chemdawg
Member
 
Registered: Jan 2005
Distribution: Mandriva
Posts: 206

Rep: Reputation: 31
Re: BOINC as a service to start at boot

Quote:
Originally posted by purelithium
I want to have BOINC start when I boot my machine where would i have to put reference to the boinc shell script for it to do this? I mean I want this to start even before the x server starts. so if i'm not logged in, it can still run.

the path to my boinc file is

/home/gelan/pgms/BOINC/

do I have to put a symlink somewhere?

I'm really not sure how to go about this.

What I did was create a user "boinc" and have the process run as that user. Do not allow BOINC to run as root. I did what it says to do on this page to get BOINC to start at boot: http://www.spy-hill.com/~myers/help/boinc/unix.html

There are a couple of modifications you may have to make with your daemon script to get it to start as a service. Post back if this does not work for you.
 
Old 11-18-2005, 12:49 PM   #3
purelithium
Member
 
Registered: Oct 2005
Location: Canada
Distribution: Mandriva 2006.0
Posts: 390

Original Poster
Rep: Reputation: 30
How should I edit the script he gave? I have no clue what to do.

and where do I put it? I tried putting it in the /etc/init.d/ as boinc, but when I ran the command

service boinc start

it gave an error

Cannot find boinc service

What do i do?

Last edited by purelithium; 11-18-2005 at 12:51 PM.
 
Old 11-18-2005, 01:47 PM   #4
chemdawg
Member
 
Registered: Jan 2005
Distribution: Mandriva
Posts: 206

Rep: Reputation: 31
Quote:
Originally posted by purelithium
How should I edit the script he gave? I have no clue what to do.

and where do I put it? I tried putting it in the /etc/init.d/ as boinc, but when I ran the command

service boinc start

it gave an error

Cannot find boinc service

What do i do?
Hi. You may not have to make any modifications if it works. Here's my setup: all boinc files are in the directory /home/boinc

The script he gave has 2 or 3 lines in it at the beginning that say this:

BOINCUSER=boinc
BOINCDIR=/var/lib/boinc
BUILD_ARCH=i686-pc-linux-gnu
BOINCEXE=/usr/bin/boinc_client

Now, you will need to edit these to fit your needs if you didn't do it exactly like he said in that article. For example, if your boinc directory is like mine it's in /home/boinc, not /var/lib/boinc. You should therefore change that line to read: BOINCDIR=/home/boinc You will also need to rename your boinc executable to whatever it says in this BOINCEXE line. I named mine "boinc", so that line in mine looks like this: BOINCEXE=/home/boinc/boinc

Now once you have it edited you need to put it where it says to put it (/etc/rc.d/init.d) and make sure you saved it as "boinc" and make sure you make it executable (chmod a+x boinc).

Also make sure you chmod your boinc executables to make them executable. Make sure you do this so it will add boinc as a service:

chkconfig --add boinc

Also, you need to make sure you change the permissions on your /home/boinc directory and all files within to give you (not just root) permissions. do this by cd'ing into /home/boinc and then do this (as root):

chown boinc:users *

if there are any folders in the /home/boinc directory make sure you change the permissions on them also.

Now you should be able to start the boinc service with "service boinc start"
You can stop it with "service boinc stop", and if you want to restart you can do a "service boinc restart".

Hope this helps
 
Old 11-18-2005, 02:12 PM   #5
purelithium
Member
 
Registered: Oct 2005
Location: Canada
Distribution: Mandriva 2006.0
Posts: 390

Original Poster
Rep: Reputation: 30
hmm.. now whenever i try to start the service, it fails...

# service boinc start
Starting BOINC client as a daemon: [FAILED]

hmm... Thank you so much for taking the time to go through all of this for me, I know how hard it is to break stuff down to simple steps like this.
 
Old 11-18-2005, 03:02 PM   #6
chemdawg
Member
 
Registered: Jan 2005
Distribution: Mandriva
Posts: 206

Rep: Reputation: 31
can you start boinc as root? su to root and then cd to the /home/boinc directory (or wherever boinc's home is) and do this:

Code:
./boinc &
see if it starts. You will have to do a ps -aux and see if it starts. If so, then the executable is not your problem, and you can try changing this: BOINCUSER=root and see if "service boinc start" will work then. If so, then permissions are your problem. I am certain we can get this working - just takes a liitle troubleshooting.
 
Old 11-18-2005, 03:22 PM   #7
purelithium
Member
 
Registered: Oct 2005
Location: Canada
Distribution: Mandriva 2006.0
Posts: 390

Original Poster
Rep: Reputation: 30
changing the BOINCUSER to root allows me to start the service now, but It doesn't seem like it's actually computing anything.

Why don't I want to do this? Why is it bad to run this as root?

Last edited by purelithium; 11-18-2005 at 03:27 PM.
 
Old 11-18-2005, 05:21 PM   #8
chemdawg
Member
 
Registered: Jan 2005
Distribution: Mandriva
Posts: 206

Rep: Reputation: 31
Quote:
Originally posted by purelithium
changing the BOINCUSER to root allows me to start the service now, but It doesn't seem like it's actually computing anything.

Why don't I want to do this? Why is it bad to run this as root?
Well, just in theory you can, but in general it's probably not the best idea to have any process that does not need to be run as root running as root. This one should not need to be run as root.

OK this sounds like a permissions problem to me. Check to make sure your boinc directory and EVERYTHING in there is owned by boinc. Do this as follows:

Code:
ls -l
you should not see root anywhere on the output. if you do see root, do this:

Code:
chown boinc:user *
then do ls -l again and see if everything is owned by boinc. The reason for this is that the user boinc cannot run things owned by root.

Are you running SETI? If so, you will have a /home/boinc/projects directory as well. You must change the ownership of that as well as everything in it to boinc as well, using the same procedure. Also, did you connect to a project? If you didn't, you won't be computing anything for sure.
 
Old 11-18-2005, 05:58 PM   #9
purelithium
Member
 
Registered: Oct 2005
Location: Canada
Distribution: Mandriva 2006.0
Posts: 390

Original Poster
Rep: Reputation: 30
excellent! it works as the boinc user now, but I'm still not seeing it using any CPU power... i open ksysguard and look at the boinc process, and it doesn't use any cpu power. but before, when I ran it inside my normal user account, I would see it using almost all of the CPU power.

I am attached to the setiathome project, and i made sure it was attached by running the boinc mgr as the webpage you linked to told me to.

Hmm...
 
Old 11-18-2005, 06:01 PM   #10
chemdawg
Member
 
Registered: Jan 2005
Distribution: Mandriva
Posts: 206

Rep: Reputation: 31
when you run it as boinc user, do this:

Code:
ps -aux
and you should see 2 things running as boinc. you should see the actual boinc program itself, and you should see the setiathome program. They should both be running as boincuser. Are they both running, or is only one running?
 
Old 11-18-2005, 06:26 PM   #11
purelithium
Member
 
Registered: Oct 2005
Location: Canada
Distribution: Mandriva 2006.0
Posts: 390

Original Poster
Rep: Reputation: 30
doh! I forgot about that, that it's not the boinc process, it's the setiathome one that does the work!

Thanks, it's working like a charm now! thanks so much!

Hopefully all this will help someone else in the future, eh?

Thanks again!
 
Old 11-18-2005, 06:46 PM   #12
purelithium
Member
 
Registered: Oct 2005
Location: Canada
Distribution: Mandriva 2006.0
Posts: 390

Original Poster
Rep: Reputation: 30
Just set it up on another box in about 5 minutes, awesome, thanks!
 
Old 11-18-2005, 07:34 PM   #13
chemdawg
Member
 
Registered: Jan 2005
Distribution: Mandriva
Posts: 206

Rep: Reputation: 31
Quote:
Originally posted by purelithium
Hopefully all this will help someone else in the future, eh?
Maybe. I continue to be amazed at the seemingly non-existant population of BOINC users that read this forum. As popular as it is, there is relatively little talk about it here.

On a related note, are you using optimized clients?
 
Old 11-18-2005, 08:44 PM   #14
purelithium
Member
 
Registered: Oct 2005
Location: Canada
Distribution: Mandriva 2006.0
Posts: 390

Original Poster
Rep: Reputation: 30
That's true, I expected to find a lot more information on here about the boinc clients!


No, I couldn't get the AMD 64 client to work at all. I'm using the general x86 linux client. I just don't feel like i'm getting the most out of my AMD dual core...

Last edited by purelithium; 11-18-2005 at 08:45 PM.
 
Old 11-18-2005, 09:04 PM   #15
chemdawg
Member
 
Registered: Jan 2005
Distribution: Mandriva
Posts: 206

Rep: Reputation: 31
Can't really help with the AMD stuff ... wish I could.

There is one more thing I forgot to mention. If your computer gets shut down improperly (power failure), BOINC will not restart as you'd expect. This is due to the presence of a lockfile that prevents it. The lockfile gets created when the service is started and deleted when it is stopped. When the power goes out, the lockfile does not get deleted. You can find it in your boinc directory. To get around this problem, you can edit that script as follows:
Code:
# Mandrake 10.1 really wants a lock file...
LOCKDIR=/var/lock/subsys
comment out the LOCKDIR so it doesn't create the lockfile:
Code:
# Mandrake 10.1 really wants a lock file...
# LOCKDIR=/var/lock/subsys
Then, you should edit these lines so that it won't ever look for a lockfile (just comment out):
Code:
   cd $BOINCDIR

      #  if [ -f lockfile ] ; then
      #    echo -n "Another instance of BOINC is running (lockfile exists)."
      #    echo_failure
      #    echo
      #    exit 4
      #  fi

That's it, except for you not using the optimized clients, your setup is exactly like mine. You might find an optimized client here or here's a bunch of places to look here There are several, you should try a few - maybe one will work. Don't forget to try both the optimized seti client AND the optimized boinc client. Both can make a difference.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get service to start at boot zaichik Linux - Newbie 12 08-27-2008 09:15 PM
Network service start at boot? King of Japan Linux - Networking 2 09-01-2005 10:23 AM
how to start a service at boot senthilkumar Slackware 2 07-19-2004 07:33 AM
NEWBIE: The boot is locked on 'start SMB service'. Please HELP ME! edika Linux - General 2 05-06-2004 02:26 AM
start the service for every boot time yuva_mca Linux - General 3 03-09-2004 01:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration