标题: [推荐]给Linux user 的启动脚本
roka
论坛知事
Rank: 3Rank: 3Rank: 3


UID 4594
精华 2
积分 312
帖子 222
阅读权限 10
注册 2005-4-7
来自 Tokyo, Japan
发表于 2005-4-10 11:17  资料  主页 短消息  加为好友 
[推荐]给Linux user 的启动脚本

自己写的启动脚本
在系统启动是自动开始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







顶部
[广告] SETI@home Astropulse 优化计算程序,推荐使用!
roka
论坛知事
Rank: 3Rank: 3Rank: 3


UID 4594
精华 2
积分 312
帖子 222
阅读权限 10
注册 2005-4-7
来自 Tokyo, Japan
发表于 2005-4-10 11:19  资料  主页 短消息  加为好友 
前提是已经进行过 第一次运行 设置







顶部
 



当前时区 GMT+8, 现在时间是 2008-12-5 02:43
沪ICP备05042587号

本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.5.0 © 2001-2007 Comsenz Inc.
清除 Cookies - 联系我们 - 中国分布式计算总站 - Archiver - WAP