11/May/2007 tested on openSUSE 10.2
This steps will install a BOINC service as a daemon on openSUSE10.2. I modified boinc-suse-1.1.1.tar.gz (init master file) to create a log file automatically if not exists. This steps also include a logrotate configuration.
# mv boinc_5.8.16_i686-pc-linux-gnu.sh /usr/local # cd /usr/local # chmod +x boinc_5.8.16_i686-pc-linux-gnu.sh # ./boinc_5.8.16_i686-pc-linux-gnu.sh # /usr/local/BOINC/run_manager
#! /bin/sh
### BEGIN INIT INFO
# Provides: boinc
# Required-Start: $ALL
# Should-Start: $ALL
# Required-Stop: $ALL
# Should-Stop: $ALL
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: boinc daemon
# Description: Start boinc for distributed computing processes
# e.g. Seti@Home
### END INIT INFO
# Check for missing binaries (stale symlinks should not happen)
# Note: Special treatment of stop for LSB conformance
BOINC_DIR=/usr/local/BOINC
BOINC_USER=nobody
BOINC_LOGFILE=/var/log/boinc
BOINC_BIN=$BOINC_DIR/boinc
test -f $BOINC_LOGFILE || touch $BOINC_LOGFILE ; chown $BOINC_USER $BOINC_LOGFILE
test -x $BOINC_BIN || { echo "$BOINC_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
. /etc/rc.status
# Reset status of this service
rc_reset
case "$1" in
start)
echo -n "Starting boinc "
## Start daemon with startproc(8). If this fails
## the return value is set appropriately by startproc.
cd $BOINC_DIR
chown $BOINC_USER $BOINC_LOGFILE
startproc -u $BOINC_USER -l $BOINC_LOGFILE -s $BOINC_BIN -dir $BOINC_DIR
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down boinc "
## Stop daemon with killproc(8) and if this fails
## killproc sets the return value according to LSB.
killproc -TERM $BOINC_BIN
# Remember status and be verbose
rc_status -v
;;
try-restart|condrestart)
## Do a restart only if the service was active before.
## Note: try-restart is now part of LSB (as of 1.9).
## RH has a similar command named condrestart.
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
# Remember status and be quiet
rc_status
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
force-reload)
## Actually restarts the service
$0 try-restart
rc_status
;;
reload)
## Actually does nothing
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for service boinc "
## Check status with checkproc(8), if process is running
checkproc $BOINC_BIN
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
exit 1
;;
esac
rc_exit
# chown nobody:nobody -R /usr/local/BOINC/ # chmod 755 /etc/init.d/boinc # chkconfig boinc on # /etc/init.d/boinc start
/var/log/boinc {
daily
compress
dateext
notifempty
rotate 10
missingok
create 600 nobody nobody
postrotate
/etc/init.d/boinc restart
endscript
}