Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Operating Systems > Linux, Unix

Reply
 
LinkBack Thread Tools
Old 11-21-07   #1 (permalink)
Linux Lobbyist
 
talntid's Avatar
 
intel nvidia

Join Date: Jun 2007
Location: Spokane, WA
Posts: 675

Rep: 100 talntid is acknowledged by manytalntid is acknowledged by many
Unique Rep: 74
Folding Team Rank: 558
Trader Rating: 7
Default How To: Folding on Linux

Before I dive into my tutorial and tell you how to setup your machine for running the Folding @ Home process I’ll take just a minute and introduce those of you unaware to what the project is.


The project is a distributed computing effort put together by Stanford University to help research protein folding and, based on that research, help in medical research for conditions such as: Alzheimer’s Disease, Huntington’s Disease, Osteogenesis Imperfecta, Parkinson’s Disease, etc. Basically, you can use your machines idle processes to help in medical research. Not a bad way to put your computer to good use!
Now to the good stuff. How do I set this up? Well there is a simple way that allows you to simply run the research application when you remember. It’ll save it’s data to your home folder (clutter things up just a bit) and stop when you stop it. This is the way I ran the program for quite a while but I found it to be a little bothersome to have to manually deal with it all the time. There were a few fixes that I found to help move it behind the scenes, but recently I really started looking into a long-term solution, which is the basis for this tutorial.
Overview:
  1. This tutorial will create a dedicated system user on your machine to run the process and store the data. Data will be stored in a subfolder of /var/ (can be changed, if you prefer).
  2. This system user will not be assigned a login, password or shell for security reasons.
  3. I will outline installation, setup and automation of starting, stopping and checking status of the application.
  4. The application will be handled with an init service for automagically starting at boot and allowing you to stop or start the service on demand.
A few notes on the tutorial syntax. Lines prefixed with the ’sudo’ command are specific for Ubuntu / Debian based machines. If you’d like to run this setup on a RHEL / FC based machine simply ’su -’ to root to run those commands. Also, near the end I have labeled [Ubuntu / Debian] or [RHEL / FC] for the distribution specific commands.


First on the list is to create a dedicated user to run this process. This is done for a few reasons. For one, some people have concerns that the Folding @ Home process may not be completely secure. While there have been no reported security vulnerabilities in its history, it is a valid concern and one that is addressed here. The Folding @ Home process runs ‘work units’ on your machine and reports back to the main servers at Stanford. One of the best ways to ensure security during this communication is to create a limited system user to handle the work. Even if the service was somehow compromised the affected user would have no access to anything, therefore effectively stopping the threat.
Quote:
sudo useradd -d /var/folding -r folding
The syntax of this, if you’re not familiar tells the new system user, folding, to use /var/folding as its home folder as opposed to the standard /home/ area.


Second (unless I can figure out the right syntax for the above command), you’ll need to manually create the folder.
Quote:
sudo mkdir /var/folding
After the folder is created you will also want to make sure that it is owned strictly by the new user.
Quote:
sudo chown folding.folding /var/folding
Now that you have the user set up, the home folder created and ownerships set properly you will want to download the ‘finstall’ script. This is a third party script that helps automate the whole process. In my testing it has been really solid and can be used on Linux, WINE, BSD or OS X based machines (w00t!).

UPDATE 4/2/08:
If you are using a 64-bit version of Ubuntu, you need to download and install the ia32-libs.
Quote:
sudo aptitude install ia32-libs





With this next command we’ll pull down an installer script that will set everything up for us. You’ll want to be in your newly created /var/folding at this point (cd /var/folding/)
Once this download has finished you’ll need to add the execute permission on the file. This is done simply with:
Quote:
sudo chmod +x finstall

Ok, now we’re about half way there.


Now we’re ready to run finstall but remembering that we want it installed, owned and run by our new user we’ll want to install it as them first. We’ll need to temporarily switch to that user now.
Quote:
sudo -i
su - folding
This will land you in a limited shell, if it can even be considered a shell, but you can still run the installer. Use the following command to launch the installer and follow the prompts.
Quote:
/bin/bash ./finstall
Now, as I mentioned, this installer is very comprehensive and will ask you quite a bit to get things setup initially. It will download the actual Folding @ Home program, allow you to verify the checksum (it’s always nice to verify that we’re installing what we think we’re installing!), and also add a FAQ where you can find out more information.


The questions that it might ask you are as follows, and appended with my suggested answers. (Depending on your system you may not see all / each question listed here.)
Quote:
Do you want to read finstall FAQ (yes/no?): n (I’ve read it a few times now, this one is up to you)
Quote:
Is this the correct MD5SUM value of FAH504-Linux.exe (yes/no?): y (double check if you like here.)
Do you want to use any of these 3rd party FAH utilities (y/n)?: y
Do you want to use automatic MachineID changing (y/n)?: y
Do you want to use it for this client and for all remaining configureless clients as well (y/n)?: y
It will also ask you for a name. The name is optional, or you can use an alias / name of your choice. You can use this page to see if the name is available. The only reason the name might be important is if you want to compare your finished work units vs a friend.
It will also ask you for a (optional) team to join. Might I suggest you join the Overclock.net Folding @ Home Team? Show your Overclock.net pride and save the world with the rest of the Overclock.net crew. To join the Overclock.net Folding @ Home Team use the number 37726.
After the questions about the name and team it prompts for a few more options. The defaults are safely used here.
Ok, once this installer finishes asking you how to set things up you’re *almost* there! Just a few more quick commands and we’re ready to set-and-forget.


You can now type ‘exit’ and ‘exit’ to leave the prompt you are in as the new folding user. The only thing left to do is create the startup script and make sure it runs as the new user.
Quote:
sudo cp foldingathome/folding /etc/init.d/
sudo update-rc.d folding defaults [Ubuntu / Debian]
chkconfig folding on [RHEL/FC]
sudo chmod 4775 foldingathome/folding
Ok. You’re ready to go now. There is a copy of the start / stop script in your init folder. The update (or chkconfig) has set this script to automagically start on multi-user runlevels and SUID permissions have been set on the script so that it will *always* run as, and with permissions of, your new limited system user.


To go ahead and start the service type:
Quote:
sudo /etc/init.d/folding start [Ubuntu / Debian]
Quote:
service folding start [RHEL/FC]
To stop the service type:
Quote:
sudo /etc/init.d/folding stop [Ubuntu / Debian]
Quote:
service folding stop [RHEL/FC]
Remember, this will now auto-start at boot so you can safely just ignore it from here on out. No more config, manually starting, remembering to start the service, etc. You’re done.






Removal Instructions:



To remove this after it has been installed can be done in just a few commands:
Quote:
sudo /etc/init.d/folding stop [Ubuntu / Debian]
Quote:
service folding stop [RHEL/FC]
sudo rm /etc/init.d/folding
sudo update-rc.d folding remove [Ubuntu / Debian]
service folding off [RHEL/FC]
sudo userdel -r folding
sudo rm -rf /var/folding
done.

System: My Rig
CPU
Q6600 @ 3.651GHz
Motherboard
ASUS P5K Deluxe Wifi-AP
Memory
4gb Ballistix Tracers DDR2 1066
Graphics Card
eVGA 8800GT 512
Hard Drive
2 x Seagate 250GB 16M | 2 x WD 400GB AAKS 16M
Sound Card
X-Fi ExtremeGamer Fatal1ty
Power Supply
Antec Earthwatts 500
Case
Black Antec P180
CPU cooling
ARCTIC COOLING Freezer 7 Pro 92mm CPU Cooler
OS
Ubuntu 64, Vista
Monitor
Samsung 226BW

Last edited by talntid : 04-02-08 at 06:50 AM.
talntid is offline I fold for Overclock.net   Reply With Quote
Old 04-02-08   #2 (permalink)
Linux Lobbyist
 
talntid's Avatar
 
intel nvidia

Join Date: Jun 2007
Location: Spokane, WA
Posts: 675

Rep: 100 talntid is acknowledged by manytalntid is acknowledged by many
Unique Rep: 74
Folding Team Rank: 558
Trader Rating: 7
Default

UPDATE 4/2/08:
If you are using a 64-bit version of Ubuntu, you need to download and install the ia32-libs.

Quote:
sudo aptitude install ia32-libs

System: My Rig
CPU
Q6600 @ 3.651GHz
Motherboard
ASUS P5K Deluxe Wifi-AP
Memory
4gb Ballistix Tracers DDR2 1066
Graphics Card
eVGA 8800GT 512
Hard Drive
2 x Seagate 250GB 16M | 2 x WD 400GB AAKS 16M
Sound Card
X-Fi ExtremeGamer Fatal1ty
Power Supply
Antec Earthwatts 500
Case
Black Antec P180
CPU cooling
ARCTIC COOLING Freezer 7 Pro 92mm CPU Cooler
OS
Ubuntu 64, Vista
Monitor
Samsung 226BW
talntid is offline I fold for Overclock.net   Reply With Quote
Old 04-02-08   #3 (permalink)
Intel Overclocker
 
yannis7777's Avatar
 
intel nvidia

Join Date: Jan 2008
Location: Athens
Posts: 1,140

Rep: 110 yannis7777 is acknowledged by manyyannis7777 is acknowledged by many
Unique Rep: 45
Trader Rating: 0
Default

Very good guide mate! Thank you!!
__________________

ThermalTake Armor Thread

NOKIA N95 Thread


3DMARK06 16486 @ 3.6 Ghz/ 16854 @3.9 Ghz @ XPx64

System: Quad Machine
CPU
Q6600 G0 @ 3.6Ghz @1.39v L733/ E8500
Motherboard
ASUS Blitz Formula SE
Memory
4x1GB 800Mhz Transcend Axeram N 5-5-5-15 @1066Mhz
Graphics Card
8800 GTS 512 G92 stable @818/1917/1107
Hard Drive
WD 320GB SATA II+250GB Hitachi 7200rpm IDE
Sound Card
Supreme FX II on Blitz Formula SE
Power Supply
Thermaltake Toughpower 750W SLI Ready
Case
Thermaltake Armor V8003SWA with 25cm side fan
CPU cooling
Thermalright Ultra 120 Extreme + 2x120mm fans
GPU cooling
Stock
OS
3ple-Boot: SuSE 10.3 - XP x64 - Vista Ultimate x64
Monitor
ASUS 22" VW222S 1680x1050
yannis7777 is offline   Reply With Quote
Old 04-02-08   #4 (permalink)
5.7L
 
Lude's Avatar
 
intel nvidia

Join Date: Apr 2006
Location: Kentucky
Posts: 1,433

Rep: 251 Lude is a proven memberLude is a proven memberLude is a proven member
Unique Rep: 168
Folding Team Rank: 144
Trader Rating: 2
Default

Wow, that is so much more complicated than i have ever done, haha. I've always done the same simple routine, about 5 or 6 steps, in Fedora and Arch. Good guide though.

System: Intel Build
CPU
E6420 @ 3.2ghz
Motherboard
ASUS P5N-E SLI 0608
Memory
2x1G G.Skill HK's @ 4-4-3-5 2T
Graphics Card
eVGA 8800GTS 320MB
Hard Drive
WD 500GB
Sound Card
Creative SB Audigy2 ZS
Power Supply
500W Enermax Liberty
Case
Cooler Master Elite
CPU cooling
AS5 + Big Typhoon
GPU cooling
Stock
OS
Vista Business
Monitor
19" BenQ LCD
Lude is offline I fold for Overclock.net Overclocked Account   Reply With Quote
Old 04-02-08   #5 (permalink)
Linux Lobbyist
 
talntid's Avatar
 
intel nvidia

Join Date: Jun 2007
Location: Spokane, WA
Posts: 675

Rep: 100 talntid is acknowledged by manytalntid is acknowledged by many
Unique Rep: 74
Folding Team Rank: 558
Trader Rating: 7
Default

My way is only like 5 or 6 steps, but I illustrate what those steps do, and why.

Half of my steps are to ensure that FAH can't hurt anything on the rig... if there is a bug or something...

System: My Rig
CPU
Q6600 @ 3.651GHz
Motherboard
ASUS P5K Deluxe Wifi-AP
Memory
4gb Ballistix Tracers DDR2 1066
Graphics Card
eVGA 8800GT 512
Hard Drive
2 x Seagate 250GB 16M | 2 x WD 400GB AAKS 16M
Sound Card
X-Fi ExtremeGamer Fatal1ty
Power Supply
Antec Earthwatts 500
Case
Black Antec P180
CPU cooling
ARCTIC COOLING Freezer 7 Pro 92mm CPU Cooler
OS
Ubuntu 64, Vista
Monitor
Samsung 226BW
talntid is offline I fold for Overclock.net   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 08:20 PM.


Overclock.net is a Carbon Neutral Site Creative Commons License Internet Security By ControlScan

Terms of Service / Forum Rules | Privacy Policy | Advertising | Become an Official Vendor
Copyright © 2008 Shogun Interactive Development. Most rights reserved.
Page generated in 0.40342 seconds with 8 queries