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

哪位朋友教一下如何在ubuntu下将folding smp加入到系统服务中?

[复制链接]
发表于 2009-6-20 14:23:56 | 显示全部楼层 |阅读模式
哪位朋友教一下如何在ubuntu下将folding smp加入到系统服务中?

在虚拟机内运行,免得每次都要手动运行。

看过官方论坛的说明,英文不好,看不明白。
回复

使用道具 举报

发表于 2009-6-20 16:27:11 | 显示全部楼层
使用64bit Ubuntu Linux 跑SMP Client 简易设置

http://www.equn.com/forum/thread-20982-1-1.html

建议兄弟多看看置顶帖子里的内容
回复

使用道具 举报

发表于 2009-6-21 09:47:59 | 显示全部楼层
正在用ubuntu9.10,还太熟悉,不过你可以用相关指令加入到启动任务。
sudo vi /etc/rc.local      #这是编辑文件需要输入root口令
文件中加入启动命令好像是           ./fah6 -smp -verbosity 9

评分

参与人数 1基本分 +5 收起 理由
金鹏 + 5 原创内容

查看全部评分

回复

使用道具 举报

 楼主| 发表于 2009-6-22 19:22:08 | 显示全部楼层
建议版主也看清楚置顶,里面没有说明如何将folding做成系统服务。

原帖由 金鹏 于 2009-6-20 16:27 发表
使用64bit Ubuntu Linux 跑SMP Client 简易设置

http://www.equn.com/forum/thread-20982-1-1.html

建议兄弟多看看置顶帖子里的内容
回复

使用道具 举报

发表于 2009-6-22 20:08:04 | 显示全部楼层

回复 #4 guihuo 的帖子

《更新FAH简介和教程等资料, 需要热心志愿者和高手们的参与》

(二)基于Ubuntu  V9.04 Linux 平台下SMP Client 教程及注意问题,如何优化

      现有参考:http://folding.stanford.edu/English/LinSMPGuide

这个英文链接页面里有设置成服务的说明

How to start the linux SMP client as a service

Note: Adding the client as a service in Linux depends on which distribution you are using. The instructions below should work for the majority of distributions available in the market. If nothing works, you might need to do some research to find out what your distribution needs to install as a service.
Do not change accounts or change directory location then create a script named folding by pasting the following commands:
echo "# chkconfig: 345 93 14" > ./folding
echo "# description: will start FAH client as a service" >> ./folding
echo "su - $USER -c \"cd $PWD; ./fah6 -smp -verbosity 9 < /dev/null >
  /dev/null 2>&1 &\"" >> ./folding
chmod +x ./folding
Note: In the following steps, replace [fahdir] with the value you saw on screen during the previous installation steps (don't include the brackets).
To mark down where you installed the FAH client just run:
echo "[fahdir] = $PWD"
Note: All the following steps need root privileges to be carried out successfully.
For Debian-based distributions run:
sudo cp [fahdir]/folding /etc/init.d/
For other distributions run:
su - -c "cp [fahdir]/folding /etc/init.d/"
Note: If you installed the client under root user account, do this instead :
echo "# chkconfig: 345 93 14" > ./folding
echo "# description: will start FAH client as a service" >> ./folding
echo "cd $PWD; ./fah6 -smp -verbosity 9 < /dev/null > /dev/null 2>&1 &" >>
  /etc/init.d/folding
chmod +x /etc/init.d/folding
Last step is to register the folding service.
For Debian-based distributions run:
sudo update-rc.d folding defaults
For other distributions run:
su - -c "chkconfig --add folding"
That's all so reboot the computer to make the new script start the client. To check if it is working fine, just go to your folding folder and open fahlog.txt or run:
tail -f [fahdir]/FAHlog.txt
回复

使用道具 举报

 楼主| 发表于 2009-6-23 11:11:16 | 显示全部楼层
看过了,不熟悉linux,操作失败。上面有基于不同内核的linux发行版本的操作,看起来很混乱,才来这里求助。

[ 本帖最后由 guihuo 于 2009-6-23 11:12 编辑 ]
回复

使用道具 举报

发表于 2009-6-23 14:20:19 | 显示全部楼层
没有基础的linux知识,对于用户来说很难,尤其各发行版本都有不同。
回复

使用道具 举报

 楼主| 发表于 2009-6-23 14:35:32 | 显示全部楼层
这才头大呢,dos倒是会,但linux就有点难度了。

原帖由 bugfix 于 2009-6-23 14:20 发表
没有基础的linux知识,对于用户来说很难,尤其各发行版本都有不同。
回复

使用道具 举报

发表于 2009-6-23 20:21:01 | 显示全部楼层
确实会让人头大。因为用虚拟机,而且一旦开机就很少关,也没有终端界面感觉也不爽,所以从来没有考虑过做成系统服务。

不过UBUNTU是基于debian的。所以按照FAH指南中debian相关的命令就可以执行。

多试试。我也是试出来的。
回复

使用道具 举报

发表于 2009-6-23 22:02:09 | 显示全部楼层
其实Linux的服务理解起来很简单。
Linux内核起来以后,会调用一个脚本去起服务,这个脚本根据不同的init等级运行不同目录下的服务启动脚本。每个服务的启动和停止脚本(合并在一个脚本文件里,由不同的参数决定是启动还是停止)都会放在一个目录里,这个目录一般是/etc/init.d/下。然后再链接到各个init等级的目录下。
大部分的Linux发行把通过改链接的名字来决定启动的顺序,如S10xxx这个链接文件,S表示启动,就是进入这个init等级要启动这个服务,相对应的K就是停止这个服务。后面的数字10表示启动顺序,数字越小启动越早。xxx是这个服务名字的描述。
小部分的Linux发行版通过在脚本中设置依赖服务项来决定启动顺序,最开始启动的那个脚本会根据依赖项决定启动顺序。
所有的Linux发行版的服务启动基本都是这个原理和过程。不同的是init等级对应的目录的名字不同,各个Linux版还会有工具帮你来加从init.d目录到init运行等级目录的链接,而这个工具又各个不同。
上面贴出来的金鹏大叔贴出来的步骤就是先创建一个folding的服务启动脚本,再把它考到/etc/init.d目录,然后用chkconfig这个工具将创建的folding启动脚本链接到init运行等级对应的目录下。在Ubuntu下,好像正常的init运行等级的服务启动脚本链接文件在/etc/runlevel下巴,好久没搞Linux了,不记得了。
在Init运行等级目录下,用ls -l 命令,可以看到他们都是链接自/etc/init.d目录下的那个服务启动脚本

评分

参与人数 1基本分 +5 收起 理由
金鹏 + 5 精品文章

查看全部评分

回复

使用道具 举报

发表于 2009-6-24 09:13:44 | 显示全部楼层
原帖由 guihuo 于 2009-6-23 11:11 发表
看过了,不熟悉linux,操作失败。上面有基于不同内核的linux发行版本的操作,看起来很混乱,才来这里求助。



期待兄弟能解决该问题,然后写出来给大家分享,到时加入到置顶教程里
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-5-14 21:34

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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