Matthew Beckler's Home Page

Home :: Blog :: General :: Software :: Hardware :: Microcontrollers :: Artsy


How to Start and Stop Folding@Home on OSX

Problem: In September 2008, I got my first computer from Apple, a MacBook Pro laptop. It runs OSX, and works alright. I wanted to try running Stanford's Folding@Home client under OSX. The client runs in the background using Apple's launchd system, and is "niced" so it doesn't interfere with my usual computer usage. When I'm on battery power, running compute-intensive simulations, or playing around with virtual machines, I want to turn off the Folding@Home client. Unfortunately, it's not at all straightforward to stop/start the client. The official preference pane seems to only change the startup behavior, that is, whether it starts on boot or not.

Solution: I did a little digging, and discovered a reliable way to stop or start the Folding@Home client whenever I want. It appears to do the Right Thing when shutting down, as the client has no trouble coming back up when I restart it. I created a small shell script to make it easier to run. Right click here to download to your computer.

#!/bin/sh

# Folding@Home on OSX Control Script
# Written by: Matthew L Beckler (matthew at mbeckler dot org)
#
# Usage: ./fah_ctl.sh {load|unload}
#
# This script will load or unload the F@H client daemon.

if [ ! $1 ] || [ "$1" != "load" -a "$1" != "unload" ]; then
    echo "Usage: `basename $0` {load|unload}"
    exit 1
else
    sudo launchctl $1 /Library/LaunchDaemons/Folding\@home.plist
fi

exit 0

Comments? Suggestions? Dissenting opinions? Email Me


Homepage Made with Vim! Validate HTML Email Me! Made with Inkscape! Validate CSS

Copyright © 2004 - 2017, Matthew L. Beckler, CC BY-SA 3.0
Last modified: 2010-03-21 12:19:07 PM (EDT)