-
How to setup the Linux F@H client as an rc to run at boot time. I'll try to make this a guide that requires no Linux knowledge.
Get the Linux client. I'm assuming you're using FAH3Console-Linux.exe and that you've managed to put a good copy of FAH3Console-Linux.exe in the /tmp directory.
Login to a command prompt on your Linux box, as user root.
Execute the following commands (in <b>bold</b> from that command prompt:
<b>mkdir /home/fah
mv /tmp/FAH3Console-Linux.exe /home/fah
chown -R root:root /home/fah
chmod +x /home/fah/FAH3Console-Linux.exe</b>
The first run of FAH3Console-Linux.exe must be made from the command prompt, to setup the folding group, etc. To do this, at the command prompt type:
<b>/home/fah/FAH3Console-Linux.exe (Enter)</b>
The Linux client acts just like the Windows command prompt client, just answer the questions and let it begin folding. Check to see if it's doing "the right thing" the same as for the windows command prompt client. It's working correctly? Good, now Control-C the running client to stop it.
Now, we need to create the file /etc/rc.d/init.d/fah with the following lines in it. This is the "batch" file that will start up your client when Linux boots.
Copy the italics text of the text file below, and paste it into notepad. Modify the file if you changed any of my default assumptions.
Highlight and copy the entire modified text of the notepad window, then login to your Linux box as user root.
From the Linux command prompt:
1. Key in
<b>vi /etc/rc.d/init.d/fah (Enter)</b>
2. Key in
<b>i</b> (Do NOT press Enter)
3. Paste the text you copied from the notepad window
4. Key in
<b>Esc</b> (The Escape key, do NOT press Enter)
5. Key in
<b>:wq</b> (do not press Enter).
You should now be back at the Linux command prompt.
This is the text to be pasted (in italics):
-------------------------------------------
<i>#!/bin/sh
#
# Startup script for Folding @ Home
#
# chkconfig: 2345 90 01
# description: F@H Linux client
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
RETVAL=0
# See how we were called.
case "$1" in
start)
echo -n "Starting f@h: "
daemon <b>/home/fah/startfah.sh</b>
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/fah
;;
stop)
echo -n "Shutting down f@h: "
killproc <b>FAH3Console-Linux.exe</b>
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/fah
;;
*)
echo "Usage: fah {start|stop}"
exit 1
esac
exit $RETVAL</i>
------------------------
End of text to be pasted
You've finished creating the "batch" file necessary to start F@H on boot.
Permissions on /etc/rc.d/init.d/fah should be -rwxr-xr-x, owner root and group root. To do this, from the command prompt key in:
<b>chown root:root /etc/rc.d/init.d/fah
chmod +x /etc/rc.d/init.d/fah</b>
We need to tell Linux to run this at boot, and set it up to do so. Key in:
<b>chkconfig --add fah</b>
to setup the appropriate run-level links.
The Linux F@H client doesn't run in the background by default (doesn't run as a daemon, or "service" in Windows terminology). So, we need to create a wrapper that makes the client behave as a deamon.
Copy this text into a notepad window, then highlight it, copy it and follow the directions below:
This is the text to be pasted (in italics):
-------------------------------------------
<i>#!/bin/sh
cd /home/fah
/home/fah/FAH3Console-Linux.exe -forceasm -advmethods >/dev/null 2>&1 &
exit 0</i>
------------------------
End of text to be pasted
From the Linux command prompt:
1. Key in
<b>vi /home/fah/startfah.sh (Enter)</b>
2. Key in
<b>i</b> (Do NOT press Enter)
3. Paste the text you copied from the notepad window
4. Key in
<b>Esc</b> (The Escape key, do NOT press Enter)
5. Key in
<b>:wq</b> (do not press Enter).
You should now be back at the Linux command prompt.
Make startfah.sh owned by root and executable:
<b>chown root:root /home/fah/startfah.sh
chmod +x /home/fah/startfah.sh</b>
Finally, start up the client like this:
<b>service fah start</b>
I'd try a planned reboot to see if this all works as desired. If it is working properly, the Linux box should boot up and you can see if the F@H client is running by running:
<b>ps -ef | grep FahCore (Enter)</b>
Last edited by sjohnson; 02-14-2003 at 04:24 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks