WHAT IS THIS WEB PAGE ABOUT?
Most of today's home computers are very fast and waste a lot of power waiting for you to do something useful. This wasted idle power can be put to good use for scientific purposes.
If you have an interest in donating your computer's spare idle CPU cycles for useful scientific research such as SETI@home (Search for Extra-Terrestrial Intelligence), Einstein@home (Search for Pulsars and Neutron Stars) or wish to donate your CPU idle time for other scientific projects then you will want to download and run BOINC (Berkeley Open Infrastructure for Network Computing).
Some linux distros today, including Mandriva 2009, now have an easy automated way of installing BOINC such as via RPM install or apt-get, but if you want the flexibility, control, or understanding of installing BOINC to your preferences, you may find this guide useful.
The steps shown here allow you to install BOINC securely and to automatically start and run under it's own BOINC user account when your computer is turned on. The BOINC software in this HowTo is installed in directory "/opt/BOINC" instead of "/home/boinc/BOINC". The reason for placing it here is so that user BOINC can run the client and any users that belong to group BOINCG can read, but not modify BOINC settings.
These steps work with Mandrake 10 up to and including Mandriva 2009 (NOTE: Mandriva 2009.1 and 2010 now has an updated MSEC which has different settings and file locations therefore many steps shown may not work as applied). You may find additional steps due to variations of BOINC versions and also variations of Mandriva (skip appropriate steps where necessary). Included in this How-To guide are additional steps you need so that BOINC can run correctly on Mandriva's Higher MSEC 4 server security level. You can skip many steps in this guide if you are running at a more Standard MSEC desktop security level.
Please note that due to all the details mentioned above, this How-To is much more work than simply setting up BOINC to run under your own user account. If you want a more generic version of How-To compatible with other versions of Linux you have a great guide written by the original author for the BOINC script used in this setup. The general guide is shown on Eric Meyer's How To Guide. There are several other How-To guides for several distros shown on the BOINC wiki.
SOME SUGGESTIONS IF INSTALLING BOINC ON A NEW COMPUTER
Skip this section if you already have installed Linux. If you plan to run a Linux file server and have not installed Linux yet, I suggest putting BOINC on a partition of it's own. The reasons for this suggestion is hard drive space, and backups.
Users may fill-up hard drive space to the point of not having room available for other programs to do their work. When you run out of room, it interferes with programs like BOINC. BOINC hard drive space requirements are somewhat steady (except for growing log files), so a small partition of 200MB, 500MB, or 1G is okay. If you have not used BOINC before and are not familiar with how much space some projects use, you may want to skip this suggestion.
When it comes to you making backups (except for occasional backups), making a backup of the BOINC working directory may not have value to you. The files are large and they change often. Putting BOINC at a location other than a default "/home/user" directory allows you to leave BOINC running and only turn it off if-and-when you decide to do a backup of the BOINC directory. It also makes your backup of home directories far simpler too because you can simply backup "/home/*" and not some other combination with complicated exclusions and exceptions to skip directories like "/home/user/BOINC".
As you can see in the partial script example below, if you make backups, and are using steps similar to this tar backup script then you can make a simple modification to backup just once a month, and only stop BOINC when you actually do backup the BOINC partition or directory:
# Create Monthly Backups on 1st day of each month if [ $DOM = "01" ]; then MakeFullMonthlyBackup "1" "$DIR1"; MakeFullMonthlyBackup "2" "$DIR2"; MakeFullMonthlyBackup "3" "$DIR3"; # Stop BOINC, then make a monthly backup. /sbin/service boinc stop MakeFullMonthlyBackup "BOINC" "/opt/BOINC"; # Done, now start BOINC /sbin/service boinc start fi |
CREATE PACCESS & BOINCG GROUPS, THEN ADD A BOINC USER ACCOUNT
Ideally, from a security point of view, you will want to create a BOINC user account just for BOINC and give it as few permissions as is necessary to the rest of your computer. The various research projects only need a network connection and knowledge of available RAM to be able to crunch numbers. Future versions of BOINC may introduce interesting features so you may want to create a shared "read-only" BOINCG group for this purpose. If you follow the suggestion of putting BOINC in another directory, such as "/opt/BOINC" instead of "/home/user/BOINC" mentioned in the previous section, it will be easier for looking at BOINC using group boincg permission access.
This HowTo guide will be using groups named paccess, boincg and a new user account named boinc which belongs to nobody except BOINC. If you want to use different names, please substitute where applicable.
Most of these steps can be done quickly on a command-line console (or shell). If you have not used a command-line console before you can usually find it by following your menu. It is likely located in "Menu->Tools->Konsole_Terminal" (older versions like 2008 may have it in a different submenu such as "Mandriva->System->Terminals->Console").
Below are the steps you enter, and below that is information about each instruction used. This example assumes your user account is named you. Please substitute the user name of your account when required.
1. 2. 3. 4. 5. 6. 7. 8. |
|
The reason for adding group paccess is so that BOINC can access "/proc" without needing adm rights to directory "/proc" while still allowing adm to access "/proc" (adm is considered an account with much higher responsibilities than a basic user account, but lower than absolute root super user mode).
ALLOW BOINC TO RUN AT HIGHER MSEC 4 LEVEL
If your computer will run using Standard MSEC 2 or High MSEC 3, you can skip this section. These steps are required to allow BOINC to run on Mandriva Higher MSEC 4 Security Level because permissions on directories will change and some programs will be terminated automatically if they are found running.
You will need to edit a file and some directory settings in su mode, so open up a command line console and follow these steps.
1. 2. 3. 4. 5. |
|
In file "perm.4" you will want to edit the line containing /proc from:
/proc root.adm 550 |
change permissions to: |
/proc/ root.paccess 550 |
and insert these new lines for a new BOINC directory: |
/opt/ root.adm 751 /opt/BOINC/ boinc.boincg 750 |
ADJUST YOUR HOSTS FILE TO REFLECT YOUR COMPUTER NAME TO THE BOINC SERVERS
You Can skip this section if you want. This is just a minor issue seen with older versions of BOINC and older versions of Mandriva. You may want to adjust your "/etc/hosts" file so that BOINC reports back the name you expect. Some "/etc/hosts" files have local as the first name in a list of names. Move your expected computer name to the front of this list. You will need to change this in su mode (If you are not sure if your Mandriva is updated correctly, substitute the command cat in place of kwrite to take a quick look at the contents of these 2 files described below).
If you also changed the name of your computer, you will want to modify the "/etc/sysconfig/network" file too to match your new computer name you placed in the "/etc/hosts" file. For a name change, both these changes will be reflected when you reboot your computer and you should reboot before getting BOINC in the next section.
1. 2. 3. 4. 5. |
|
Here is an example before you edit the file:
127.0.0.1 localhost genesis GENESIS |
This is after you move your computer name to the front: |
127.0.0.1 genesis localhost GENESIS |
NETWORKING=yes HOSTNAME=localbox |
This is after you add or modify the HOSTNAME line: |
NETWORKING=yes HOSTNAME=genesis |
Note: If you changed your computer's name to a new name, the simplest way to have the new changes take effect is to do a reboot. You will notice the name change reflected on the commandline (using the above example, it will change from [you@localbox ~] to [you@genesis ~]).
SWITCH TO USER BOINC AND GO GET THE LATEST BOINC
At this point, you are ready to get the files needed. Log out of your user account and log into the BOINC user account. Once you have logged into your computer's BOINC user account, open up an Internet web browser and Download the latest stable BOINC file to your DeskTop or your ~ ( /home/boinc/ ) directory.
RUN THE SCRIPT, EDIT SOME SETTINGS
The latest version of BOINC at the time this How-To was originally written was version 5.8.16 and there are many improvements made since then. You are encouraged to use the latest BOINC, but if you cannot, there are steps included here to allow you to install older versions of BOINC such as 5.8.16. for those of you running the latest Linux and latest BOINC several steps in this How-To can be skipped (skip steps where appropriate).
In this section, you will change to directory "/opt" and build the "/opt/BOINC/" directory and files, then set group permissions to boincg.
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. |
|
This will create a "BOINC/" directory with the following files of interest:
boinc | BOINC core client. This program will be run as a daemon using a BOINC start-up script supplied later on this web page. |
boincmgr | BOINC manager. This program manages the client program, shows stats and is used for choosing projects. It is best to run this using the run_manager script. |
run_client | A script that cd's into the BOINC directory and runs the core client. This script should be renamed to run_client.sh if you want Konqueror to automatically recognize it as a script, but since this How-to will setup your computer to start BOINC on power-up, this script is not really needed then (we will not modify it or rename it). |
run_manager | A script that cd's into the BOINC directory and runs the manager. This script should be renamed to run_manager.sh so that older versions of Konqueror can automatically recognize it as a script (such as Mandriva 2008). Then it will be edited using Kwrite. |
#!/bin/sh cd "/opt/BOINC" && exec ./boincmgr $@ |
GET THE INIT SCRIPT, EDIT BOINC SCRIPT IF NECESSARY
If you want BOINC to automatically start when your computer is turned-on, you will need an init daemon script such as this one. Download this script file, or copy this script below. If you are not using Mandriva, you may want to use a more generic script and edit it to match your setup, for example, use this one Eric Meyer's Script.
If you prefer to copy and paste to a script called boinc then copy the listing below.
#!/bin/sh # # BOINC - start and stop the BOINC client daemon on Unix # # Unix start/stop script to run the BOINC client as a daemon at # system startup, as the 'boinc' user (not root!). # # This version works on Red Hat Linux, Fedora Core, Mandriva, # and Slackware Linux, and should work on generic Linux systems # provided they have 'pidof'. Metadata for chkconfig and the SUSE # equivalent INIT info are included below. # # Usage: boinc { start | stop | restart | status } # #### # chkconfig: 345 98 03 # description: This script starts the local BOINC client as a daemon \ # BOINC lets you donate your idle computer time to science \ # projects like SETI@home, Climateprediction.net, Rosetta@home, \ # World Community Grid, and many others. \ # For more info about BOINC (the Berkeley Open Infrastructure \ # for Network Computing) see http://boinc.ssl.berkeley.edu # processname: boinc # config: /etc/sysconfig/boinc # ### BEGIN INIT INFO # Provides: boinc # Required-Start: $network # Required-Stop: $network # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Short-Description: BOINC client daemon initialization script # Description: This script starts the local BOINC client as a daemon \ # BOINC lets you donate your idle computer time to science \ # projects like SETI@home, Climateprediction.net, Rosetta@home, \ # World Community Grid, and many others. \ # For more info about BOINC (the Berkeley Open Infrastructure \ # for Network Computing) see http://boinc.ssl.berkeley.edu ### END INIT INFO # # Eric Myers <myers@vassar.edu> - 27 July 2004 # Department of Physics and Astronomy, Vassar College, Poughkeepsie NY # Eric Myers <myers@spy-hill.net> # Spy Hill Research, Poughkeepsie, New York # # Jose Da Silva <digital@joescat.com> - 27 October 2007 # Minor changes plus used LSB style error return codes 0..7 # # @(#) $Id: boinc,v 1.8.2 2007/10/27 01:01:01 Joses Exp $ ######################################################################## # Defaults, these can be overridden in /etc/sysconfig/boinc BOINCUSER=boinc BOINCDIR=/opt/BOINC BOINCEXE=boinc BOINCERR=0 # Additional BOINC options: # Be wary of -allow_remote_gui_rpc, as it can open your machine up # to the world if you don't set a password, or if you set a poor one. # Should be okay if you are behind a NAT firewall. #BOINCOPTS="-allow_remote_gui_rpc" # opens up your machine to the world! BOINCOPTS= # Log and error files (you should rotate these occasionally) #LOGFILE=boinc.log #ERRORLOG=error.log # Or if you are not using them at all, then send them to null LOGFILE=/dev/null ERRORLOG=/dev/null # Look for any local configuration settings which override all above if [ -f /etc/sysconfig/boinc ]; then . /etc/sysconfig/boinc elif [ -f /etc/default/boinc ]; then . /etc/default/boinc fi # Source function library. if [ -f /etc/init.d/functions ] ; then . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ] ; then . /etc/rc.d/init.d/functions else exit 0 fi # Direct paths to commands used in this script (no path searches needed) CHMOD=/bin/chmod CHOWN=/bin/chown ECHO=/bin/echo NICE=/bin/nice PIDOF=/sbin/pidof RM=/bin/rm SLEEP=/bin/sleep SU=/bin/su TOUCH=/bin/touch # Mandriva 2009 really wants a lock file located here ... if [ -d /var/lock/subsys ]; then LOCKDIR=/var/lock/subsys elif [ -d /var/lock ]; then LOCKDIR=/var/lock fi ## Locate the boinc directory and executable if [ ! -d $BOINCDIR ]; then $ECHO -n $"Cannot find the BOINC directory: ${BOINCDIR}" echo_failure $ECHO exit 5 fi if [ ! -x "$BOINCDIR/$BOINCEXE" ]; then $ECHO -n $"Cannot find the BOINC executable client: ${BOINCEXE}" echo_failure $ECHO exit 5 fi # Functions: $1 is one of start|stop|restart|status case "$1" in start) $0 stop cd $BOINCDIR if [ -f lockfile ]; then $ECHO -n $"Another BOINC is running here (lockfile exists)." echo_failure BOINCERR=3 fi if [ ! -f client_state.xml -o ! -d projects ]; then $ECHO -n $"This BOINC client requires initialization." echo_warning BOINCERR=6 fi $ECHO -n $"Starting BOINC service:" $NICE $SU $BOINCUSER -c "$BOINCDIR/$BOINCEXE $BOINCOPTS" >>$LOGFILE 2>>$ERRORLOG & $SLEEP 3 PID=`$PIDOF -s -x -o $$ -o $PPID -o %PPID $BOINCEXE` if [ $PID ]; then $TOUCH "$LOCKDIR/$BOINCEXE" echo_success else echo_failure BOINCERR=1 fi ;; stop) cd $BOINCDIR if [ ! -f lockfile -a ! -f "$LOCKDIR/$BOINCEXE" ]; then $ECHO -n $"${BOINCEXE} is not running (no lockfile found)." echo_success else $ECHO -n $"Stopping ${BOINCEXE} client daemon:" killproc $BOINCEXE && echo_success || echo_failure fi $RM -f lockfile $RM -f "$LOCKDIR/$BOINCEXE" ;; restart) $0 stop $0 start ;; status) PID=`$PIDOF -x -o $$ -o $$PPID -o %PPID boinc_client` if [ "$PID" == "" ]; then PID=`$PIDOF -x -o $$ -o $$PPID -o %PPID $BOINCEXE` fi if [ "$PID" != "" ]; then $ECHO -n $"${BOINCEXE} (pid $PID) is running..." echo_success #kill -SIGUSR1 $PID; else if [ -f "$BOINCDIR/lockfile" -o -f "$LOCKDIR/$BOINCEXE" ]; then $ECHO -n $"${BOINCEXE} is stopped but lockfile exists." echo_warning BOINCERR=7 else $ECHO -n $"${BOINCEXE} is not running!"; # Do not echo OK or FAIL. result may be okay, or not. fi fi ;; *) $ECHO $"Usage: ${0} {start|stop|restart|status}" exit 1 esac $ECHO exit $BOINCERR |
INSERT THE BOINC SCRIPT IN THE INIT.D DIRECTORY, SET SERVICE
Save the file above in directory "/etc/init.d" as file boinc. The steps below assume you downloaded the script file to your Desktop.
1. 2. 3. 4. 5. 6. 7. 8. |
|
[root@genesis boinc]# chkconfig --level 345 boinc on [root@genesis boinc]# chkconfig --list boinc boinc 0:off 1:off 2:off 3:on 4:on 5:on 6:off [root@genesis boinc]# ls -l /etc/rc[0-6].d/*boinc* lrwxrwxrwx 1 root root 15 Sep 30 12:00 /etc/rc0.d/K03boinc -> ../init.d/boinc* lrwxrwxrwx 1 root root 15 Sep 30 12:00 /etc/rc1.d/K03boinc -> ../init.d/boinc* lrwxrwxrwx 1 root root 15 Sep 30 12:00 /etc/rc2.d/K03boinc -> ../init.d/boinc* lrwxrwxrwx 1 root root 15 Sep 30 12:00 /etc/rc3.d/S98boinc -> ../init.d/boinc* lrwxrwxrwx 1 root root 15 Sep 30 12:00 /etc/rc4.d/S98boinc -> ../init.d/boinc* lrwxrwxrwx 1 root root 15 Sep 30 12:00 /etc/rc5.d/S98boinc -> ../init.d/boinc* lrwxrwxrwx 1 root root 15 Sep 30 12:00 /etc/rc6.d/K03boinc -> ../init.d/boinc* |
OPTIONAL CHECK, STOP THE COMPUTER, RESTART, VERIFY BOINC STARTS
If you want to verify that BOINC actually starts when your computer is turned on, exit, shutdown the computer, restart, enter the boinc user account and do a check.
1. 2. 3. 4. |
|
TIME TO ADD PROJECTS FOR BOINC TO WORK ON
If you have done the previous steps and encountered no problems, then at this point, you know that the BOINC client program daemon is working fine and will start as soon as your computer is turned on. You do not need to log in and start it each time because it is automatic now. It is running as user boinc and that it is running in directory "/opt/BOINC".
Time to add projects to work on because the default install has no work to do yet. Log into the BOINC user account and start the BOINC manager which you placed on the Desktop (in one of the earlier steps). Click on the Desktop boinc.sh shortcut link to launch the BOINC manager. From this point onwards (version 6.4.5 and better is easy to follow), follow the prompts and begin adding whichever projects you prefer to work on. Here is a List of BOINC Projects.
Once you are done adding all the projects you wish to work with, it is worth suggesting to you that you should set BOINC to run at 100% since there are lots of programs that may confuse BOINC into waiting for other programs to finish. The boinc start-up script sets BOINC to run at a very "nice" priority and the operating system is far more efficient at deciding where to use idle time compared to BOINC's periodic polls to test your computer to see how busy it is (for example, polling may allow BOINC to prioritize in 5 minute chunks of time, but "nice" will allow you to make use of the tiny gaps of time between you typing "Hello World" on your keyboard).
The "nice" level is quite low and this low "nice" value makes it so almost every process on your computer will have a higher priority than BOINC and therefore BOINC should not slow down your computer for what you usually do, whether this is your computer, file server, or whatever this computer is used for. In summary, you really should not notice that BOINC is running at all. If you want to check it out, use the top command to see it run (below is an example which shows an idle computer busy working at Einstein@home. You'll notice the Nice value of 19 for Einstein which keeps your computer busy while idle, yet allows almost every other program to have higher priority so that your computer always responds promptly for what you want to do):
|
Once you have finished working with the BOINC manager, exit, then log-out of the boinc user account completely since you no longer need to be here. Go back to your normal user account. Boinc is now working during idle time and will start up on boot up.
If you need to adjust anything in BOINC, just log into the boinc user account and click on the DeskTop shortcut, do what you need to do and then log out again.
Many of the steps done above could be skipped and are somewhat towards setting BOINC with group access, but BOINC is not quite yet shareable yet since this version (6.4.5) of BOINC is not quite multi-user ready yet, but it is getting closer. If you find what is needed to allow other group users to watch BOINC without affecting BOINC's operation, please send a comment. Thanks.
You are Done.
If you find this HowTo useful, see some errors, corrections, or improvements that can be added, please send them. Thanks.
Links To Sections Of This BOINC How To | |||
---|---|---|---|
Top Of Page | Some Suggestions | Create BOINC and Groups | Boinc At MSEC 4 |
Adjust HOSTS File | Download BOINC | Run And Edit | Get BOINC Daemon |
Add BOINC To Init.d | Reset Computer Test | Add Projects | Comments |