I'm helping a guy to create a boot script for BOINC. I've installed programs and created boot scripts without problems on Solaris but Linux Mandrake has just given us one problem after another. We've been working on the script for 2 days now. I asked for help on the Predictor forum but it's down otherwise I'd be posting there :)

We've created this boot script and using chkconfig it's now set to run on boot - 2345. It won't start though - "Another copy of BOINC is already running". Testing the script from the command line gives us the same error. A ps -ef shows no copy of BOINC running. I asked him to add an if but that doesn't do anything - "Another copy of BOINC is already running". Aaaaaaaaaargh. Permissions are ok and there's no lock or pid file as far as we know.

Though I didn't write it, here's a script that I use on one of my Mandrake 10 systems. It works with no problem.

#!/bin/sh

# boincctl - Control boinc. Stop it/Start it/Restart it. Originally
# meant to be used as a boot time script so that boinc starts
# at boot time, but can be used any time. For a boot time script
# put this in /etc/init.d and make the appropriate links from
# the appropriate run level areas (ie. /etc/rc3.d). (This was
# developed on RedHat 9 so I know what the boot areas are there.
# It should also work on Solaris, I'm not familiar with other
# flavors of Linix/UNIX.)

#
# Variables that will need to be configured.
#
# BOINC_HOME: The directory where boinc will run. It should be run
# in its own directory to keep its files and subdirectories
# separate form others.
#
# BOINC_BIN: The full path to the boinc executable.
#
# RUN_AS: Username that boinc is to run as.
#
# BOINC_OUT: File to direct output from boinc. If you don't want this,
# set it to /dev/null.
#
# BOINC_PARMS: Any command line parameters for boinc you wish to pass to
# it. If you don't want any, simply use a null list ("").

# If the user running this script is not the user we want boinc to run as, set
# up the su command so that we can become that user. Note, we will have to
# know this user's password. If this script is run at boot time, it is root
# that is running this script and no password is required.

> Though I didn't write it, here's a script that I use on one of my Mandrake 10
> systems. It works with no problem.
>

Thanks. The script we've created was based on that script and the Predictor script.

I had a look at the BOINC source code and it seems that BOINC might be exiting because of a problem with semaphores. At the moment, the only user that can run BOINC is root - ordinary users can't run it. I'm thinking that there might be something wrong with the system settings for semaphores. I'm not entirely certain of what I'm looking for, or what the values should be. Any input would be appreciated.

> Though I didn't write it, here's a script that I use on one of my Mandrake 10
> systems. It works with no problem.
>
(snip script)
>
>
I had to make one small change to get it to work for me... I had to change the "eval $su_cmd" to "su " to make it quit complaining about not having the correct paramaters to su. Since I'm running it as root, there's no need to supply the password for that user. :-)

Hmm... it SAID it was starting BOINC, but for some reason it's not running... PS aux | grep boinc says it's not running... I'm gonna have to look into this... :(