Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: HOWTO: Autostart Folding at Home at startup

  1. #1
    Join Date
    Oct 2004
    Beans
    172
    Distro
    Ubuntu 10.04 Lucid Lynx

    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 11:15 PM.

  2. #2
    Join Date
    Oct 2004
    Location
    Texas, USA
    Beans
    411

    Re: Autostart Folding at Home at startup

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

    Rancoras
    Linux User #64203

  3. #3
    Join Date
    Oct 2004
    Beans
    172
    Distro
    Ubuntu 10.04 Lucid Lynx

    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.

  4. #4
    Join Date
    Oct 2004
    Beans
    172
    Distro
    Ubuntu 10.04 Lucid Lynx

    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%.

  5. #5

    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 04:23 PM.

  6. #6
    Join Date
    Oct 2004
    Beans
    172
    Distro
    Ubuntu 10.04 Lucid Lynx

    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?

  7. #7
    Join Date
    Jul 2005
    Location
    Austin
    Beans
    16
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    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 ;]

  8. #8
    Join Date
    Apr 2005
    Location
    IRC or Forums
    Beans
    543
    Distro
    Ubuntu

    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
    Last edited by XDevHald; July 9th, 2005 at 11:30 PM.
    AskDroid - Android Q&A Community

  9. #9
    Join Date
    Nov 2004
    Location
    Belgium
    Beans
    13

    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

  10. #10
    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

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •