|
自己写的启动脚本
在系统启动是自动开始BOINC
使用方法:
1,在/etc/rc.d/init.d/下建立一个文件 如boincd ,拷贝下面的内容
2,加上执行权限 chmod +x boincd
3,加入启动脚本到 /etc/rc.d/rc.local
boincd start
即可
Redhat9 kernel 2.4.20通过
(注 BOINC的地方我都写的bonic 呵呵)
#!/bin/bash
#
# Startup script for Bonic
#
# description: Bonic is a World Wide Distribute Computing Project. It is used to serve Einstein@home
#
# processname: bonic
# logfile: $LOGFILE
# errorfile: $ERRORFILE
#
# Author : K.Ro 2005.04.10
# Source function library.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/bonic ]; then
. /etc/sysconfig/bonicd
fi
# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""
# Set bisic PATH to use the server
# Path to the bonic script, and logfiles.
bonic_DIR=/root/Dis/
bonic_BIN=./boinc_4.19_i686-pc-linux-gnu
OPTIONS="-update_prefs http://einstein.phys.uwm.edu/ -return_results_immediately"
LOGFILE=/root/Dis/boinc-log
ERRORFILE=/root/Dis/boinc-errors
prog=bonic
#RETVAL=0
# The semantics of these two functions differ from the way bonic does
# things -- attempting to start while running is a failure, and shutdown
# when not running is also a failure. So we just do it the way init scripts
# are expected to behave here.
# Simplely By K.Ro
start() {
echo -n $"Starting $prog: "
cd $bonic_DIR;exec $bonic_BIN > $LOGFILE 2>$ERRORFILE &
}
stop() {
echo -n $"Stopping $prog: "
killproc $bonic_BIN
}
reload() {
echo -n $"Reloading $prog: "
killproc $bonic_BIN -HUP
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $bonic
;;
restart)
stop
start
;;
# condrestart)
# if [ -f /var/run/.pid ] ; then
# stop
# start
# fi
# ;;
reload)
reload
;;
graceful|help|configtest|fullstatus)
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}"
exit 1
esac |
|