forked from pool/boinc-client
76 lines
2.7 KiB
Diff
76 lines
2.7 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:
|
||
|
+#
|
||
|
+BOINCGROUP=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}
|
||
|
@@ -178,8 +182,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 +283,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 +333,10 @@ 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
|
||
|
+ if [ -z `sudo -u $BOINCUSER /bin/sh -c "if test -O ${BOINCDIR} ;
|
||
|
+ then echo success ; fi"` ]; then
|
||
|
echo -n ERROR: $BOINCDIR is not owned by $BOINCUSER.
|
||
|
echo_failure
|
||
|
echo
|