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

[推荐]给Linux user 的启动脚本

[复制链接]
发表于 2005-4-10 11:17:22 | 显示全部楼层 |阅读模式
自己写的启动脚本
在系统启动是自动开始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
回复

使用道具 举报

 楼主| 发表于 2005-4-10 11:19:00 | 显示全部楼层
前提是已经进行过 第一次运行 设置
回复

使用道具 举报

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

本版积分规则

论坛官方淘宝店开业啦~

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

GMT+8, 2024-4-25 10:05

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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