1
0
forked from pool/boinc-client
boinc-client/boinc-init.patch

85 lines
2.9 KiB
Diff

Index: client/scripts/boinc-client.in
===================================================================
--- client/scripts/boinc-client.in.orig
+++ client/scripts/boinc-client.in
@@ -19,13 +19,13 @@
# 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
# Provides: boinc
-# Required-Start: $network
-# Required-Stop: $network
-# Default-Start: 3 4 5
+# Required-Start: $network $remote_fs
+# Required-Stop: $network $remote_fs
+# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: This script monitors the BOINC client.
# Description: This script starts the local BOINC client as a daemon
@@ -117,6 +117,10 @@ fi
#
BOINCUSER=boinc
+# Name of group to run as:
+#
+BOINCUSER=boinc
+
# 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
@@ -128,7 +132,7 @@ BOINCDIR=/var/lib/boinc
# 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}
@@ -161,9 +165,7 @@ BOINCOPTS=
# 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
@@ -178,8 +180,8 @@ export TERM=dumb
# 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
@@ -279,7 +281,7 @@ if [ ! -d $BOINCDIR ]; then
echo -n "Creating $BOINCDIR "
if mkdir -p $BOINCDIR 2>/dev/null ; then
if [ -n "$BOINCUSER" ] ; then
- if chown $BOINCUSER $BOINCDIR ; then
+ if chown $BOINCUSER $BOINCGROUP $BOINCDIR ; then
echo_success
else
echo_failure
@@ -329,8 +331,8 @@ if [ "${USERNOW}" = "${BOINCUSER}" ] ; t
exit 8
fi
elif [ "${USERNOW}" = "root" ] ; then
- cmd="if test -O ${BOINCDIR} ; then echo success ; fi"
- if [ -z `su $BOINCUSER -c "$cmd"` ]; then
+ # cmd="if test -O ${BOINCDIR} ; then echo success ; fi"
+ # if [ -z `su $BOINCUSER -c "$cmd"` ]; then
echo -n ERROR: $BOINCDIR is not owned by $BOINCUSER.
echo_failure
echo