|
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:
- cd /folding
- ./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):
- 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:
- su -
- 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...):
- cd /folding
- 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...):
- cd /folding
- 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:
- killall -15 FAH502-Linux.exe
复制代码
and if it is still not dead (check it with "/sbin/pidof FAH502-Linux.exe") then:
- 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用户来跑是安全一些的! |
|