2011-04-28 19:29:54 +02:00
|
|
|
Index: client/scripts/boinc-client.in
|
|
|
|
===================================================================
|
|
|
|
--- client/scripts/boinc-client.in.orig
|
|
|
|
+++ client/scripts/boinc-client.in
|
2012-02-02 21:59:26 +01:00
|
|
|
@@ -19,14 +19,16 @@
|
2011-04-28 19:29:54 +02:00
|
|
|
# For more information about BOINC (the Berkeley Open Infrastructure
|
|
|
|
# for Network Computing) see http://boinc.berkeley.edu
|
|
|
|
# processname: boinc
|
|
|
|
-# config: /etc/sysconfig/boinc
|
|
|
|
+# config: /etc/sysconfig/boinc-client
|
|
|
|
#
|
|
|
|
### BEGIN INIT INFO
|
2012-02-02 21:59:26 +01:00
|
|
|
-# Provides: boinc
|
2011-04-28 19:29:54 +02:00
|
|
|
-# Required-Start: $network
|
|
|
|
-# Required-Stop: $network
|
|
|
|
-# Default-Start: 3 4 5
|
2012-02-02 21:59:26 +01:00
|
|
|
-# Default-Stop: 0 1 2 6
|
|
|
|
+# Provides: boinc-client
|
|
|
|
+# Required-Start: $network $remote_fs
|
|
|
|
+# Should-Start: $time
|
|
|
|
+# Required-Stop: $network $remote_fs
|
|
|
|
+# Should-Stop: $time
|
|
|
|
+# Default-Start: 3 5
|
|
|
|
+# Default-Stop: 0 1 2 6
|
2011-04-28 19:29:54 +02:00
|
|
|
# Short-Description: This script monitors the BOINC client.
|
|
|
|
# Description: This script starts the local BOINC client as a daemon
|
2012-02-02 21:59:26 +01:00
|
|
|
# For more information about BOINC (the Berkeley Open Infrastructure
|
|
|
|
@@ -117,6 +119,10 @@ fi
|
2011-04-28 19:29:54 +02:00
|
|
|
#
|
|
|
|
BOINCUSER=boinc
|
|
|
|
|
|
|
|
+# Name of group to run as:
|
|
|
|
+#
|
2011-08-30 20:19:26 +02:00
|
|
|
+BOINCUSER=boinc
|
2011-04-28 19:29:54 +02:00
|
|
|
+
|
|
|
|
# Working directory. Could be /home/boinc, /var/lib/boinc, etc..
|
|
|
|
# The reason I prefer /var/lib/boinc is that this works best for a
|
|
|
|
# cluster of computers where /home/anything might be shared between machines
|
2012-02-02 21:59:26 +01:00
|
|
|
@@ -128,7 +134,7 @@ BOINCDIR=/var/lib/boinc
|
2011-04-28 19:29:54 +02:00
|
|
|
# but I like to rename it and put it in a public place.
|
|
|
|
# (Hint: move boincmgr to /usr/local/bin too so anyone can easily use it).
|
|
|
|
#
|
|
|
|
-BOINCEXE_NAME=boinc_client
|
|
|
|
+BOINCEXE_NAME=boinc-client
|
|
|
|
BOINCEXE=${bindir}/${BOINCEXE_NAME}
|
|
|
|
BOINCCMD_NAME=boinccmd
|
|
|
|
BOINCCMD=${bindir}/${BOINCCMD_NAME}
|
2012-02-02 21:59:26 +01:00
|
|
|
@@ -161,9 +167,7 @@ BOINCOPTS=
|
2011-08-30 20:19:26 +02:00
|
|
|
# Subsys lock file ...
|
|
|
|
|
|
|
|
# If there is the subsys directory, then use it ...
|
|
|
|
-if [ -d /var/lock/subsys/ ]; then
|
|
|
|
- LOCKFILE=/var/lock/subsys/${BOINCEXE_NAME}
|
|
|
|
-elif [ -d /var/lock ]; then
|
|
|
|
+if [ -d /var/lock ]; then
|
|
|
|
LOCKFILE=/var/lock/${BOINCEXE_NAME}
|
|
|
|
elif [ -d /var/run ]; then
|
|
|
|
LOCKFILE=/var/run/${BOINCEXE_NAME}.lock
|
2012-02-02 21:59:26 +01:00
|
|
|
@@ -178,8 +182,8 @@ export TERM=dumb
|
2011-04-28 19:29:54 +02:00
|
|
|
# but if the functions are not found we create our own simple replacements.
|
|
|
|
# (The idea for replacing the functions comes from OpenAFS. Thanks guys!)
|
|
|
|
|
|
|
|
-if [ -f /etc/rc.d/init.d/functions ] ; then
|
|
|
|
- . /etc/rc.d/init.d/functions
|
|
|
|
+if [ -f /etc/init.d/functions ] ; then
|
|
|
|
+ . /etc/init.d/functions
|
|
|
|
else
|
|
|
|
if printf "Hello" >/dev/null 2>/dev/null ; then
|
|
|
|
# printf works
|
2012-02-02 21:59:26 +01:00
|
|
|
@@ -279,7 +283,7 @@ if [ ! -d $BOINCDIR ]; then
|
2011-04-28 19:29:54 +02:00
|
|
|
echo -n "Creating $BOINCDIR "
|
|
|
|
if mkdir -p $BOINCDIR 2>/dev/null ; then
|
|
|
|
if [ -n "$BOINCUSER" ] ; then
|
|
|
|
- if chown $BOINCUSER $BOINCDIR ; then
|
2011-08-30 20:19:26 +02:00
|
|
|
+ if chown $BOINCUSER $BOINCGROUP $BOINCDIR ; then
|
2011-04-28 19:29:54 +02:00
|
|
|
echo_success
|
|
|
|
else
|
|
|
|
echo_failure
|
2012-02-02 21:59:26 +01:00
|
|
|
@@ -329,8 +333,8 @@ if [ "${USERNOW}" = "${BOINCUSER}" ] ; t
|
2011-04-28 19:29:54 +02:00
|
|
|
exit 8
|
|
|
|
fi
|
|
|
|
elif [ "${USERNOW}" = "root" ] ; then
|
|
|
|
- cmd="if test -O ${BOINCDIR} ; then echo success ; fi"
|
|
|
|
- if [ -z `su $BOINCUSER -c "$cmd"` ]; then
|
2011-08-30 20:19:26 +02:00
|
|
|
+ # cmd="if test -O ${BOINCDIR} ; then echo success ; fi"
|
|
|
|
+ # if [ -z `su $BOINCUSER -c "$cmd"` ]; then
|
2011-04-28 19:29:54 +02:00
|
|
|
echo -n ERROR: $BOINCDIR is not owned by $BOINCUSER.
|
|
|
|
echo_failure
|
|
|
|
echo
|