Running BOINC at startup

Questions and Answers : Macintosh : Running BOINC at startup
Message board moderation

To post messages, you must log in.

AuthorMessage
LineNoise

Send message
Joined: 22 Apr 01
Posts: 3
Credit: 134,968
RAC: 0
Australia
Message 2671 - Posted: 29 Jun 2004, 14:38:45 UTC

Does anyone know how to run BOINC at startup?

I've been fiddling around trying to get it to work with the startup items settings under the Accounts settings but having no luck. Will this work at all or do I need to resort to cron or something? And if so how do I configure that?
ID: 2671 · Report as offensive
Niels Meersschaert

Send message
Joined: 29 Oct 99
Posts: 5
Credit: 159,887
RAC: 0
United States
Message 3711 - Posted: 3 Jul 2004, 16:05:15 UTC
Last modified: 3 Jul 2004, 16:08:02 UTC

The easiest way is to create a startup item. The advantage of startup items is that they announce themselves on startup with messages shown on the startup screen. You may have seen things like 'Starting web server', etc. This will say starting seti.

To do this, open the Library folder in the root of your hard drive (not the one in your home folder). If you've installed other applications which made the folder, you should have a folder named 'StartupItems'. If not, create one. Inside of that folder, create another folder & name it 'SETI@Home'. Inside of this folder you need to create two files. The first is a simple batch script, the second is a paramater list file. You can create both using TextEdit.

Make a new file & save it into the SETI@Home folder created above with the name 'SETI@Home' (same name as the folder that contains it). Now edit the file and put in the following text:

#!/bin/sh

##
# Start SETI@home daemon
##

. /etc/rc.common


ConsoleMessage "Starting SETI@home"

cd /Applications/Seti/

/Applications/Seti/boinc_3.18_powerpc-apple-darwin -return_results_immediately &


This assumes that you've placed the boinc application in a folder called Seti in your Applications directory. Change the file as necessary to reflect your environment. The cd is important if you want the logs to stay in your application folder. You need to make this file executable, much like you needed to make Boinc executable. Simple chmod a+x will suffice.

Now for the paramater list. This is a simple xml file:







Description
SETI@home Boinc daemon
Messages

start
Starting SETI@home Boinc Version
stop
Stopping SETI@home Boinc Version

OrderPreference
Last
Provides

SETI@home Boinc Version

Requires

Multiuser Login Prompt






You now have a startup item that will display 'Starting SETI@home Boinc Version' in the startup screen at boot.
ID: 3711 · Report as offensive
LineNoise

Send message
Joined: 22 Apr 01
Posts: 3
Credit: 134,968
RAC: 0
Australia
Message 4026 - Posted: 4 Jul 2004, 14:57:47 UTC - in response to Message 3711.  

Thanks this is EXACTLY what I was after.

Cheers/
ID: 4026 · Report as offensive
Colin

Send message
Joined: 3 Apr 99
Posts: 9
Credit: 40,998
RAC: 0
United States
Message 4297 - Posted: 5 Jul 2004, 5:39:15 UTC
Last modified: 5 Jul 2004, 5:42:30 UTC

I'm going to add an alternate method here for two reasons:

a. If you have a wireless connection, your network may not be up while the startup process is running, so if you start BOINC then, it won't be able to check in with the server.
b. This method covers the possibility that BOINC may be unexpectedly terminated and need restarting.

Caveat: This method assumes that the computer is always logged in under a single user, which is how most OS X setups are used. This method also assumes that you're not using cron for anything else. If you are, you probably have enough knowledge to adapt this method to your purposes.

1. Download BOINC.
2. Place it in its own folder somewhere. I have fink installed already, so I put it in /sw/boinc/, but you can put it anywhere you like. For the rest of these instructions, I will use /sw/boinc/ to refer to wherever it is you've put BOINC.
3. Open the Terminal.
4. Type cd /sw/boinc
5. Type ./boinc_3.18_powerpc-apple-darwin
6. Follow the instructions to configure your account and project (see the SETI@home documentation for details).
7. Once BOINC has downloaded some work and starts chewing away on it, type control-c to exit BOINC.
8. Open TextEdit.
9. In the Format menu, choose Make Plain Text.
10. Paste in the following:

5 * * * * cd /sw/boinc/; if ps -aux | grep -v grep | grep "boinc"; then exit; else ./boinc_3.18_powerpc-apple-darwin; fi

(Be sure to replace /sw/boinc/ with wherever you put BOINC, be sure the entire text string is on one line, and be sure to hit return a couple times to leave a couple of blank lines at the end.)
11. Save this file to your Desktop as boinc.txt, then quit TextEdit.
12. Go back to the Terminal.
13. Type crontab ~/Desktop/boinc.txt
14. Quit Terminal.
15. Delete boinc.txt from your desktop.
16. Reboot just to be safe.

You're done! From now on, whenever you're logged in, the program you copied into TextEdit above will run every five minutes. It will move to the BOINC folder, check to see whether BOINC is running, and then start it if it isn't.

I welcome corrections and improvements, although this script has been shown to work on my machine.
ID: 4297 · Report as offensive
cobalt

Send message
Joined: 22 Nov 02
Posts: 2
Credit: 86,034
RAC: 0
United Kingdom
Message 5813 - Posted: 9 Jul 2004, 21:35:33 UTC - in response to Message 4297.  

for some reason this doen't seem to want to work on my machine Colin.

I have followed your instructions to the letter but even after restarting and leaving my machine for a few hours nothing see,s to be happening.

Have you got any other suggestions or could there be something I have missed? I have to confess to not being a unix expert.

ID: 5813 · Report as offensive
Profile toffuuu
Volunteer tester

Send message
Joined: 30 Mar 00
Posts: 87
Credit: 1,887,469
RAC: 0
United States
Message 6308 - Posted: 11 Jul 2004, 0:50:59 UTC - in response to Message 5813.  
Last modified: 11 Jul 2004, 1:16:23 UTC

> for some reason this doen't seem to want to work on my machine Colin.
>
> I have followed your instructions to the letter but even after restarting and
> leaving my machine for a few hours nothing see,s to be happening.
>
> Have you got any other suggestions or could there be something I have missed?
> I have to confess to not being a unix expert.
>
>
Try using pico in terminal using the same configs that colin gave you, and once u save instead of being in ur desktop, it will be in your home directory... type in pico boinc.txt press return and follow Colins advise if the 5 doesn't work try 0 at the beginning... this will only be saved in ur home directory if you haven't already cd'ed into another directory, otherwise it will be saved in whatever folder u are in in terminal..
ID: 6308 · Report as offensive
Colin

Send message
Joined: 3 Apr 99
Posts: 9
Credit: 40,998
RAC: 0
United States
Message 6335 - Posted: 11 Jul 2004, 2:29:25 UTC - in response to Message 5813.  
Last modified: 11 Jul 2004, 2:34:04 UTC

> for some reason this doen't seem to want to work on my machine Colin.
>
> I have followed your instructions to the letter but even after restarting and
> leaving my machine for a few hours nothing see,s to be happening.
>
> Have you got any other suggestions or could there be something I have missed?
> I have to confess to not being a unix expert.

Well, first, there have been a lot of problems getting work from the servers this week, so if you're just going by CPU usage you may not see whether it's really on or not. The way to tell is to open Activity Monitor (in the Utilities folder) and look through the list of processes for one called "boinc_3.18_power". If it's there, the procedure worked. Try waiting a day or so to see if it picks up some jobs.

If you're still not having any luck or you can't see boinc in the process list, open Terminal and type:

crontab -l

(that's l as in lizard)
Then paste the result in this thread and I'll see if I can identify a problem.
ID: 6335 · Report as offensive
Profile Tony Salcedo

Send message
Joined: 3 Apr 99
Posts: 2
Credit: 648,503
RAC: 0
United States
Message 7457 - Posted: 14 Jul 2004, 0:43:31 UTC - in response to Message 4297.  
Last modified: 14 Jul 2004, 0:46:09 UTC

I will add one small correction to Colin's crontab solution.

> 5 * * * * cd /sw/boinc/; if ps -aux | grep -v grep | grep "boinc"; then exit;
> else ./boinc_3.18_powerpc-apple-darwin; fi
...
> You're done! From now on, whenever you're logged in, the program you copied
> into TextEdit above will run every five minutes. It will move to the BOINC
> folder, check to see whether BOINC is running, and then start it if it isn't.

This check will run at 5 minutes after the hour, every hour, i.e. 1:05, 2:05 ...

To run every five minutes change the "5" at the very begining of the line to:

*/5 * * * * cd /sw/boinc/; if ps -aux | grep -v grep | grep "boinc"; then exit; else ./boinc_3.18_powerpc-apple-darwin; fi

I also suggest adding the following line at the begining of the boinc.txt file:

MAILTO=""

This prevents cron from mailing all output from boinc & setiathome to your mbox,
and having it grow to many megabytes over time.

ID: 7457 · Report as offensive
Colin

Send message
Joined: 3 Apr 99
Posts: 9
Credit: 40,998
RAC: 0
United States
Message 7549 - Posted: 14 Jul 2004, 5:12:07 UTC - in response to Message 7457.  

> I also suggest adding the following line at the begining of the boinc.txt
> file:
>
> MAILTO=""
>
> This prevents cron from mailing all output from boinc & setiathome to your
> mbox,
> and having it grow to many megabytes over time.

Thanks for the tip. For anyone who followed my original directions, you can remove the archived mail that cron has sent you by going to /var/mail/ and deleting the file that has your username.
ID: 7549 · Report as offensive
Profile Sterling Anderson

Send message
Joined: 3 Apr 99
Posts: 1
Credit: 255,788
RAC: 0
United States
Message 7899 - Posted: 14 Jul 2004, 18:24:39 UTC

The cron method is good but if you have any jobs setup in cron prior to running "crontab ~/Desktop/boinc.txt" in the terminal they will be replaced by the contents of the text file.
ID: 7899 · Report as offensive
Colin

Send message
Joined: 3 Apr 99
Posts: 9
Credit: 40,998
RAC: 0
United States
Message 8173 - Posted: 15 Jul 2004, 5:36:01 UTC - in response to Message 7899.  
Last modified: 15 Jul 2004, 6:38:06 UTC

> The cron method is good but if you have any jobs setup in cron prior to
> running "crontab ~/Desktop/boinc.txt" in the terminal they will be replaced by
> the contents of the text file.

Hence the sentence in paragraph two: "This method also assumes that you're not using cron for anything else."

If you are, you can always run "crontab -l" before you start to get the current crontab, then add it to the boinc.txt file and load that as the new crontab.
ID: 8173 · Report as offensive
Profile LarryB56
Volunteer tester
Avatar

Send message
Joined: 22 Apr 02
Posts: 73
Credit: 4,402,310
RAC: 0
United States
Message 56549 - Posted: 22 Dec 2004, 16:22:14 UTC

OK;
There is FINALLY an answer to this question that does NOT involve Terminal in ANY way.
Thanks to Bob Delaney, who made the SETI Control Program. The latest version (v3.2) has, in the preferences, an option to start SETI/BOINC when launching the SETI Control Program.

SETI Control Version 3.2
Created By Bob Delaney
Copyright 2004 Bob Delaney

Just add SETI Control to your startup items with the Start SETI/BOINC option turned on.

GREAT Stuff;
Larry
LarryB56
ID: 56549 · Report as offensive

Questions and Answers : Macintosh : Running BOINC at startup


 
©2024 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.