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

如何把FAH Linux客户端作为后台服务来运行!

[复制链接]
发表于 2006-1-19 13:53:49 | 显示全部楼层 |阅读模式
B) To get the FAH Linux Console client run as background service.

Q: Why to run FAH as a service?
A: Service by definition will run on background and will be started when You boot up Your machine and will be "killed" when You turn off the box. It is the most effective way to increase the productivity of the FAH client and all the rest what will come out of it.

I) After previous steps (download and manual run) add couple lines of code to the end of rc.local (/etc/rc.d/rc.local) file:

  1. cd /folding
  2. ./FAH502-Linux.exe >/dev/null &
复制代码




Note: This script will run FAH under root privileges as rc.local file will be run under root privileges (all created files/folders will be under root privileges, too). To overcome this and to run FAH as regular user (RegularUser must be set to one of user who is present on this system):

  1. su - RegularUser -c "cd /folding; ./FAH502-Linux.exe >/dev/null &"
复制代码



If You ran first-time-run as root or as some other user than RegularUser then You must change FAH folder privileges:

  1. su -
  2. chown -R RegularUser.RegularUserGroup /folding
复制代码




Only bad thing is that there is no easy (as easy as pressing [CRTL+C]) way to stop this client anymore.
As FAH will start up several processes then there is nothing else to do than hunt down and kill these processes. To make our life a little easier FAH client will die if the running cores die (should be a rule but not always...):

  1. cd /folding
  2. kill -15 $(ps -C $(ls *Core_*.exe) -o pid=)
复制代码


Note: This is a "polite" termination (waiting FAH client and cores to finish their job) and if ps -ax should still show some cores running (newer cores may have this bug) then use a forced termination (no more waiting...):

  1. cd /folding
  2. kill -9 $(ps -C $(ls *Core_*.exe) -o pid=)
复制代码



Attention! As FAH and Core different versions tend to respond differently to "killing" of these then it may be advisable to issue the same kind of "kill routines" to FAH client itself, too:

  1. killall -15 FAH502-Linux.exe
复制代码



and if it is still not dead (check it with "/sbin/pidof FAH502-Linux.exe") then:

  1. killall -9 FAH502-Linux.exe
复制代码


( http://forum.folding-community.org/viewtopic.php?p=65627#65627 )

Note: To get a FAH client to run on multi cpu machine, You must install as many FAH clients to separate directories as there are processors in Your machine and You may need to configure Your clients to use different Machine IDs (look to "Configuring the client").
Note: Never copy FAH files between separate clients as the usual outcome is more often bad than good.

使用非root用户来跑是安全一些的!
回复

使用道具 举报

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

本版积分规则

论坛官方淘宝店开业啦~

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

GMT+8, 2025-5-12 13:47

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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