Jump to content

Folding : Folding on Linux


ColinD

Recommended Posts

  • Administrators

Folding under Linux



The Linux Folding@home client is command line-based only (no graphical client or screen saver).

The following instructions assume that you will be working from a command shell (terminal window). In most distros, you can launch a terminal window from the GUI by selecting System Tools - Terminal from the menus. If you are new to Linux, please note that command and file names in Linux are all case sensitive. On the other hand, if you're a Linux veteran, just bear with me (most of the following will probably be painfully obvious to you).

Basic client installation

To install the Folding@home client on a Linux system, you need to do the following:
  1. Create a subdirectory in your home directory to put the Folding@home files in. I like to name the directory something descriptive... like folding.
  2. Download the latest Linux client from Stanford's site and save it to the directory you created in step 1. The remaining instructions assume that you've downloaded the 5.02 client, FAH502-Linux.exe. If you have downloaded a newer client, substitute the appropriate file name in all of the instructions below.
  3. Navigate to the folding directory (using the cd command), and enter the command: chmod +x FAH502-Linux.exe to mark the client as executable.
  4. Run the client, and configure it. Assuming you are still in the folding directory, all you need to do is enter: ./FAH502-Linux.exe and the client should start. It prompts for your configuration options, just like the Windows console client does. Don't forget to enter 42567 as your team ID!

Once you have configured the client, it will continue to run in your terminal window. If you don't mind starting the client manually every time you log in, you're done. The client will stop when you log out; if you need to stop it manually for some reason, just hit ^C (control-C) in your terminal window. To start it up again, just navigate to your folding directory and enter: ./FAH502-Linux.exe If you'd like to automate things a bit more, read on...

Creating a script to launch the client in the background

You can easily create a script that will run the client as a background process. Using whatever plain text editor is bundled with your GUI (or vi if you're a seasoned UNIX hacker, or just plain masochistic), create the following text file:

#!/bin/bash

./FAH502-Linux.exe -forceasm >>folding.log 2>&1 &

I've included the -forceasm switch as an example; you can also specify any other switches you want to pass to the client. Save the above file to a short, easy to remember file name, like go. Also mark the file as executable, by entering the following command in your terminal window: chmod +x go. From now on, you can launch the client in the background simply by navigating to your folding directory, and typing: ./go

Running the client as a service

To have the folding client to start automatically when the system boots, you need to add it to your system's startup script. Under Redhat/Fedora, the startup script is located in the file /etc/rc.d/rc.local. This script is executed during system startup (well, actually during init level changes, but that discussion is beyond the scope of this article), after all other system initialization has been completed. Other distros may put it in a slightly different location, so if you don't see an rc.local script in the /etc/rc.d directory, you may need to poke around a bit, or do a little Googling to figure out where the appropriate file is located in your distro.

Suse boot.local under init.d.

Once you've found the file, all you need to do is append the following line to the end of the rc.local script (you must be logged in as root to edit the rc.local script):

sudo -u joeblow sh -c "cd ~joeblow/folding; ./go"

(Substitute the actual name of the user under which the client is installed for joeblow.)

In a nutshell, this says "pretend we are user joeblow, go to his folding directory, and run the go script that is located there."

Odds and ends

OK, so you're running the Linux client in the background. Maybe you've even installed it as a service. How do you check on its status, or kill the client?

Checking on the status of the client is easy; just like the Windows version, everything the client does is logged in the FAHlog.txt file. You can examine the contents of that file to see what the client is doing. You can also use the tail -f command in a terminal window to continuously display the log file as it updates. The command:

cd ~/folding; tail -f FAHlog.txt

can be used in a terminal window to display a running log of what the client is doing, even if the client itself is running in the background.

The top command can be used in a terminal window to display a list of processes (similar to Windows' Task Manager). By default the display is sorted in descending order by CPU usage; unless the system is particularly busy, the Folding@home client should be near the top of the list.

To stop a client that is running as a background process or service, use the command:

killall FAH502-Linux.exe

You must be logged in as either the root user, or the user under which the client is running in order to kill it.

Source:http://techreport.com/etc/folding/#Linux

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Community Partner

×
×
  • Create New...

Important Information

Welcome to BRISKODA. Please note the following important links Terms of Use. We have a comprehensive Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.