|
#!/bin/bash
#
# Startup script for Folding@home
#
# description: FAH is a World Wide Distribute Computing Project. It is used to serve FAH
#
# processname: fahs
# logfile: $LOGFILE
# errorfile: $ERRORFILE
#
# Author : K.Ro 2005.04.10
# [email protected]
# Source function library.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/fahd ]; then
. /etc/sysconfig/fahd
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.
FAH_DIR=/root/Dis/Finding/
FAH_BIN=./FAH4Console-Linux.exe
FAH_M1=FahCore_78.exe
FAH_M2=FahCore_65.exe
FAH_M3=FahCore_82.exe
LOGFILE=/root/Dis/Finding/fah-log
ERRORFILE=/root/Dis/Finding/fah-errors
prog=folding@home
#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 $FAH_DIR;exec $FAH_BIN > $LOGFILE 2>$ERRORFILE &
echo
}
stop() {
echo -n $"Stopping $prog: "
killproc $FAH_M1
echo
killproc $FAH_M2
echo
killproc $FAH_M3
echo
killproc $FAH_BIN
echo
}
reload() {
echo -n $"Reloading $prog: "
killproc $FAH_BIN -HUP
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
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 |
|