Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old January 21st, 2005   #1
ions
Gee! These Aren't Roasted!
 
Join Date: Oct 2004
Beans: 162
Ubuntu 9.10 Karmic Koala
HOWTO: Autostart Folding at Home at startup

I run mine from a dir I created called .FAH in the home directory:

Code:
mkdir ~/.FAH
Change into that directory:

Code:
cd ~/.FAH/
I know the ~ isn't necessary but in case you're not in home when you start doing this you're still gonna be ok.

Then dowload the FAH console found here: http://folding.stanford.edu/download.html

For the lazy:

Code:
wget http://www.stanford.edu/group/pandegroup/release/FAH502-Linux.exe
Don't get mad at me if the version changes and that link breaks.

Run and configure it to your username, team and machine ID as they tell you here:

http://folding.stanford.edu/linux.html

Feel free to join the #justlinux irc regulars and choose team #36480. We're doing well.

Now let's make it start at startup!
First create the script that will run FAH:

Code:
sudo nano -w /etc/init.d/foldingathome
It will look like this:

Code:
#!/bin/bash

pushd /home/user/.FAH/
su user -c "screen -d -m ./FAH502-Linux.exe"
popd
C-o to save it in nano.

Now let's make it executable:

Code:
sudo chmod +x /etc/init.d/foldingathome
Now let's link it to the runlevel:

Code:
sudo ln -s /etc/init.d/foldingathome /etc/rc2.d/S99foldingathome
*Thanks to Retsaw & maccorin for the help.

Last edited by ions; January 21st, 2005 at 06:15 PM..
ions is offline   Reply With Quote
Old January 21st, 2005   #2
Rancoras
Quad Shot of Ubuntu
 
Rancoras's Avatar
 
Join Date: Oct 2004
Location: Texas, USA
Beans: 414
Re: Autostart Folding at Home at startup

This needs a HOWTO: tag on the title.
__________________
--Join the march for individuality!

Rancoras
Linux User #64203
Rancoras is offline   Reply With Quote
Old January 21st, 2005   #3
ions
Gee! These Aren't Roasted!
 
Join Date: Oct 2004
Beans: 162
Ubuntu 9.10 Karmic Koala
Re: Autostart Folding at Home at startup

Quote:
Originally Posted by Rancoras
This needs a HOWTO: tag on the title.
You'll have to do that, I can edit the topic line that appears in the thread but not the title that appears in the HOWTO area.
ions is offline   Reply With Quote
Old January 23rd, 2005   #4
ions
Gee! These Aren't Roasted!
 
Join Date: Oct 2004
Beans: 162
Ubuntu 9.10 Karmic Koala
Re: Autostart Folding at Home at startup

Quote:
Originally Posted by ions
You'll have to do that, I can edit the topic line that appears in the thread but not the title that appears in the HOWTO area.
A problem has occured. When FAH is started via this method it freezes once reaching 100% on a WU. Started normally it does not freeze at 100%.
ions is offline   Reply With Quote
Old February 5th, 2005   #5
Saibei
First Cup of Ubuntu
 
Join Date: Feb 2005
Beans: 10
Send a message via ICQ to Saibei Send a message via AIM to Saibei
Re: Autostart Folding at Home at startup

For those that have trouble, this is how I did it:

Make a directory to install F@H in. Location doesn't particularly matter... I chose /home/fah so I'll be using that throughout the post. Download the F@H client to the newly created folder and run it as root:
Code:
sudo mkdir /home/fah
cd /home/fah
sudo wget http://www.stanford.edu/group/pandegroup/release/FAH502-Linux.exe
sudo chmod +x FAH502-Linux.exe
sudo ./FAH502-Linux.exe
Enter the required info, and when F@H starts working on a work unit, close the client. Now to set up the startup scripts.

Make a file called fah in the /etc/init.d directory:
Code:
sudo gedit /etc/init.d/fah
Paste this into /etc/init.d/fah:
Code:
#!/bin/sh
# /etc/init.d/fah for Ubuntu
# Start/stop/restart the F@H service.

fah_start() {
 if [ -x /home/fah/startfah.sh ]; then
   echo "Starting F@H:  /home/fah/startfah.sh"
   /home/fah/startfah.sh
 fi
}

fah_stop() {
 sudo killall FAH502-Linux.exe
}

fah_restart() {
 fah_stop
 sleep 2
 fah_start
}

case "$1" in
'start')
 fah_start
 ;;
'stop')
 fah_stop
 ;;
'restart')
 fah_restart
 ;;
*)
 fah_start
esac
Save the file and close gedit, and finally make the file executable:
Code:
sudo chmod +x /etc/init.d/fah
Now the startfah.sh script:
Code:
sudo gedit /home/fah/startfah.sh
and paste this into it:
Code:
#!/bin/sh
cd /home/fah
/home/fah/FAH502-Linux.exe -forceasm -advmethods >/dev/null 2>&1 &
exit 0
And don't forget to make it executable!
Code:
sudo chmod +x /home/fah/startfah.sh
Feel free to remove the -forceasm and -advmethods flags, or add others of your own. I find those flags increase my weekly output a bit. For more info on what they do, see here.

last and final step! Make a symlink into the /etc/rc2.d directory!
Code:
ln -s /etc/init.d/fah /etc/rc2.d/S99fah
You can either test the script by rebooting or by typing the command:
Code:
sudo /etc/init.d/fah start
Open the System Monitor and watch your CPU usage skyrocket

Many thanks to XtremeSystems for the startfah.sh script and a good friend of mine for the /etc/init.d/fah script

Last edited by Saibei; February 5th, 2005 at 11:23 AM..
Saibei is offline   Reply With Quote
Old April 3rd, 2005   #6
ions
Gee! These Aren't Roasted!
 
Join Date: Oct 2004
Beans: 162
Ubuntu 9.10 Karmic Koala
Re: HOWTO: Autostart Folding at Home at startup

I've tried both my method and Saibei's since moving to Hoary and can't get F@H to autostart. Any idea why that would be or am I likely doing something wrong?
ions is offline   Reply With Quote
Old July 9th, 2005   #7
beatyou
5 Cups of Ubuntu
 
beatyou's Avatar
 
Join Date: Jul 2005
Location: Austin
Beans: 15
Ubuntu 9.04 Jaunty Jackalope
Send a message via AIM to beatyou
Re: Autostart Folding at Home at startup

Quote:
Originally Posted by Saibei
For those that have trouble, this is how I did it:

Make a directory to install F@H in. Location doesn't particularly matter... I chose /home/fah so I'll be using that throughout the post. Download the F@H client to the newly created folder and run it as root:
Code:
sudo mkdir /home/fah
cd /home/fah
sudo wget http://www.stanford.edu/group/pandegroup/release/FAH502-Linux.exe
sudo chmod +x FAH502-Linux.exe
sudo ./FAH502-Linux.exe
Enter the required info, and when F@H starts working on a work unit, close the client. Now to set up the startup scripts.

Make a file called fah in the /etc/init.d directory:
Code:
sudo gedit /etc/init.d/fah
Paste this into /etc/init.d/fah:
Code:
#!/bin/sh
# /etc/init.d/fah for Ubuntu
# Start/stop/restart the F@H service.

fah_start() {
 if [ -x /home/fah/startfah.sh ]; then
   echo "Starting F@H:  /home/fah/startfah.sh"
   /home/fah/startfah.sh
 fi
}

fah_stop() {
 sudo killall FAH502-Linux.exe
}

fah_restart() {
 fah_stop
 sleep 2
 fah_start
}

case "$1" in
'start')
 fah_start
 ;;
'stop')
 fah_stop
 ;;
'restart')
 fah_restart
 ;;
*)
 fah_start
esac
Save the file and close gedit, and finally make the file executable:
Code:
sudo chmod +x /etc/init.d/fah
Now the startfah.sh script:
Code:
sudo gedit /home/fah/startfah.sh
and paste this into it:
Code:
#!/bin/sh
cd /home/fah
/home/fah/FAH502-Linux.exe -forceasm -advmethods >/dev/null 2>&1 &
exit 0
And don't forget to make it executable!
Code:
sudo chmod +x /home/fah/startfah.sh
Feel free to remove the -forceasm and -advmethods flags, or add others of your own. I find those flags increase my weekly output a bit. For more info on what they do, see here.

last and final step! Make a symlink into the /etc/rc2.d directory!
Code:
ln -s /etc/init.d/fah /etc/rc2.d/S99fah
You can either test the script by rebooting or by typing the command:
Code:
sudo /etc/init.d/fah start
Open the System Monitor and watch your CPU usage skyrocket

Many thanks to XtremeSystems for the startfah.sh script and a good friend of mine for the /etc/init.d/fah script
Thanks saibei ;]
beatyou is offline   Reply With Quote
Old July 9th, 2005   #8
XDevHald
Grande Half-n-Half Cinnamon Ubuntu
 
XDevHald's Avatar
 
Join Date: Apr 2005
Location: IRC or Forums
Beans: 934
Ubuntu 9.10 Karmic Koala
Re: Autostart Folding at Home at startup

Worked like a charm!

Also note that I have created an UbuntuForums Team. If one of the Admins would like to take over this team please PM me and I will give you the password.

The Team ID Number Is: 45399
The Team WebPage Is: http://vspx27.stanford.edu/cgi-bin/m...&teamnum=45399

EDIT:
Yes the start up script works perfectly
__________________
Hosting Feedback - General Web Directory

Last edited by XDevHald; July 9th, 2005 at 06:30 PM..
XDevHald is offline   Reply With Quote
Old September 21st, 2005   #9
mongolito404
Spilled the Beans
 
mongolito404's Avatar
 
Join Date: Nov 2004
Location: Belgium
Beans: 10
Re: Autostart Folding at Home at startup

You can also use finstall to your Folding@Home client and then use the provided folding script.
Simply execute finstall, follow the instructions and then
Code:
sudo cp <install path>/foldingathome/folding /etc/init.d/folding
sudo update-rc.d folding defaults
mongolito404 is offline   Reply With Quote
Old October 5th, 2005   #10
simonp
First Cup of Ubuntu
 
Join Date: Sep 2005
Beans: 4
Re: Autostart Folding at Home at startup

ive just got ubutnu installed im a toal noob to Linux by the way. I followed the above text and thought i was going well got the FAh running and dowloaded a wu
and carried on with the rest of the tutorial I think i may have gone wrong at the startFAh bit in the folder startfah.sh i can see the text that I copied and pasted
and then it goes on to say make it execuatable so i saved the startfah and opened the terminal window and pasted the next bit I think i cocked up here
How do i go about starting again ? Ive gone into the process monitor and disabled the FAH process it wasnt running anyway my cpu was only showing 2%
thanks for looking
simonp is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:21 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry