|
//Xeon 5110 * 2
//Centos 4.7 //PS: centos 5.1/.2/.3 在这机子上全都挂 -_-
//BOINC 6.4.5 cli Version
//新增用户组
- # groupadd boinc
- # useradd -g boinc -m -s /sbin/nologin boinc
复制代码
//获取boinc
- # wget http://boincdl.ssl.berkeley.edu/dl/boinc_compat_6.4.5_i686-pc-linux-gnu.sh
复制代码
//修改执行权限 //并释放包
- # chmod 0700 ./boinc_compat_6.4.5_i686-pc-linux-gnu.sh
- # ./boinc_compat_6.4.5_i686-pc-linux-gnu.sh
复制代码
//将BOINC移到/usr/local/ PS:习惯丢这里..//创建data数据目录//修改BOINC及其子目录所属用户组//
- # mv BOINC/ /usr/local/
- # cd /usr/local
- # mkdir /usr/local/BOINC/data
- # chown -R boinc:boinc BOINC/
- # cd BOINC/
复制代码
//这里非常重要.!不然就会出现 “Scheduler request failed: problem with the SSL CA cert (path? access rights?) “
//把证书(可能是证书吧..之前错误消息写certificate...)//复制到data数据目录...//以后不爽就清data就好...
- # cp ca-bundle.crt ./data/
复制代码
//添加项目到boinc //看到开始下载运算单元以后按下键盘Ctrl+C终止
//a4aafc29d6e0d42ade5fe7d6ea6474df这里改成自己的id hash....不然分就给我了喔...
- # su -c "cd /usr/local/BOINC;./boinc --dir /usr/local/BOINC/data --attach_project [url]http://www.worldcommunitygrid.org/[/url] a4aafc29d6e0d42ade5fe7d6ea6474df" --login boinc
复制代码
//创建rc脚本
- # vi /usr/local/BOINC/boinc.sh
复制代码
//内容
- #!/bin/sh
- #
- # BOINC daemon control script.
- #
- # Written for Centos 4.7 by xjflyttp <[email protected]>.
- # Comments to support chkconfig on RedHat Linux
- # chkconfig: 345 20 80
- # description: BOINC daemon
- BOINC_ROOT="/usr/local/BOINC"
- BOINC_DATA="${BOINC_ROOT}/data"
- BOINC_PASS=$(cat "$BOINC_DATA/gui_rpc_auth.cfg")
- BOINC_HOST="127.0.0.1"
- BOINC_USER=boinc
- #
- # Use LSB init script functions for printing messages, if possible
- #
- lsb_functions="/lib/lsb/init-functions"
- if test -f $lsb_functions ; then
- . $lsb_functions
- else
- log_success_msg()
- {
- echo " SUCCESS! $@"
- }
- log_failure_msg()
- {
- echo " ERROR! $@"
- }
- fi
- fn_start() {
- echo "Starting..."
- su -c "cd ${BOINC_ROOT};./boinc --dir ${BOINC_DATA} -daemon" --login ${BOINC_USER}
- log_success_msg
- }
- fn_stop() {
- echo "Stopping..."
- su -c "cd ${BOINC_ROOT};./boinccmd --host ${BOINC_HOST} --passwd ${BOINC_PASS} --quit" --login ${BOINC_USER}
- log_success_msg
- }
- fn_restart() {
- fn_stop
- sleep 5
- fn_start
- }
- fn_status() {
- su -c "cd ${BOINC_ROOT};./boinccmd --host ${BOINC_HOST} --passwd ${BOINC_PASS} --get_state" --login ${BOINC_USER}
- }
- case "$1" in
- 'start')
- fn_start
- ;;
- 'stop')
- fn_stop
- ;;
- 'restart')
- fn_restart
- ;;
- 'status')
- fn_status
- ;;
- *)
- echo "usage: $0 {start|stop|restart|status}"
- esac
复制代码
//创建符号链接到rc目录
- # ln -s /usr/local/BOINC/boinc.sh /etc/init.d/boinc
复制代码
//加入到chkconfig管理
- # chkconfig --add boinc
- # chkconfig --level 345 boinc on
复制代码
//启动boinc//停止boinc
- # service boinc start
- # service boinc stop
复制代码
//修改配置文件
- # vi /usr/local/BOINC/data/global_prefs.xml
复制代码
//cpu_usage_limit //cpu占用
//max_ncpus_pct //cpu数量
- <global_preferences>
- <cpu_usage_limit>90.000000</cpu_usage_limit>
- <max_ncpus_pct>75.000000</max_ncpus_pct>
- </global_preferences>
复制代码
//rc脚本没有做启动停止boinc的校验..我自己这边试没有什么问题..
[ 本帖最后由 xjflyttp 于 2009-4-7 11:29 编辑 ] |
|