找回密码
 新注册用户
搜索
查看: 8064|回复: 4

[推荐]FAH 的 Linux restart script

[复制链接]
发表于 2005-4-10 12:58:26 | 显示全部楼层 |阅读模式
#!/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
#          roka100@gmail.com

# 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
回复

使用道具 举报

发表于 2005-5-12 19:33:37 | 显示全部楼层
我的最简单,呵呵。

#/fah/fah.sh

cd /fah
./fah >/dev/null 2>& 1  

#/etc/rc.d/rc.local
/fah/fah.sh&

放到 /etc/rc.d/rc.local 中后台执行即可,主要是省事。
回复

使用道具 举报

发表于 2005-5-12 19:34:43 | 显示全部楼层
加精了,给 LINUX 环境的弟兄参考参考。
回复

使用道具 举报

发表于 2005-5-14 23:19:10 | 显示全部楼层
学linux感觉太累,好多硬件驱动都要手工改,从显示字体到输入法也要改,就连聊天软件也要花上大功夫。样样要改配置文件,感觉就象在二次开发。。。。。。。。。。。。。
回复

使用道具 举报

发表于 2005-5-15 00:29:08 | 显示全部楼层
我的基本上都是服务器来的,所以连X WINDOWS 都不要的,根本就不会去配置那些乱七八糟的东西。呵呵。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 新注册用户

本版积分规则

论坛官方淘宝店开业啦~
欢迎大家多多支持基金会~

Archiver|手机版|小黑屋|中国分布式计算总站 ( 沪ICP备05042587号 )

GMT+8, 2024-4-29 05:11

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表