EXTREME Overclocking  - Building A Diskless Folding @ Home Farm Article - Page: 4
Home | Reviews | Forums | Downloads | $ EXTREME Deals $ | RealTime Pricing | Free Magazines | Gear | Folding Stats Newsletter | Contact Us
kangaroos

Building A Diskless Folding @ Home Farm

Project: Folding @ Home
Date Written: November 25, 2002
Written By: Jason Rabel

 

Configuration Files (cont):

The lts.conf file is pretty basic, when you add more machines you just add a new ws00x entry. For running just folding you shouldn't need a swap file, but you can create one should you deem it necessary or you are running something else that takes up more RAM. The RCFILE_01 entry tells it to run the folding @ home script, which I will go into more detail later. I set the RUNLEVEL at 3, which will put you at the shell on the client machine so you can do some diagnostic stuff to make sure everything is working, if you set the RUNLEVEL to 4 then you will only get a prompt on the client machine which will let you telnet to the farm server. It really shouldn't matter which you set it at since they aren't going to be hooked up to anything. I leave them at 3 because if a client doesn't look like it is folding I can hook up a monitor & keyboard to try and diagnose the problem locally.

/opt/ltsp/i386/etc/lts.conf

#
# Config file for the Linux Terminal Server Project (www.ltsp.org)
#
[Default]
SERVER = 192.168.2.100
DNS_SERVER = 192.168.1.254
# SEARCH_DOMAIN = "your.domain.org"
USE_XFS = N
LOCAL_APPS = N
RUNLEVEL = 4
USE_NFS_SWAP = N
#--------------------------------------------------
[ws001]
USE_NFS_SWAP = N
SWAPFILE_SIZE = 32m
RUNLEVEL = 3
RCFILE_01 = startfah

[ws002]
USE_NFS_SWAP = N
RUNLEVEL = 3
RCFILE_01 = startfah

 

The exports file contains the directories that each client will mount. The first two are your root file system, and a swap file directory (should you ever choose to use swapping). Since the F@H client requires its own directory to do work, I created a /fah directory off of the root directory on the Farm Server, then each client gets their own directory names ws00x, the directories need to be the same as the hostname in the dhcp.conf file to be mounted correctly. When initially creating the directory, you only need the F@H executable and the config file it generates, the rest of the files will be auto-generated. Do not copy any of the other files as one of them is supposed to be unique for each machine!

Just to note again, I chose to store the folding directory on the server incase a client crashed, or had to be rebooted. If it was stored merely in RAM then you would loose all your previous work. Also you can monitor the client logs on the server much easier to make sure they are running.

/etc/exports

## LTS-begin ##
# Note, some lines might wrap because of length, each entry
# should be only one line!

/opt/ltsp/i386 192.168.2.100/255.255.255.0 (ro,no_root_squash,sync)
/var/opt/ltsp/swapfiles 192.168.2.100/255.255.255.0 (rw,no_root_squash,async)

/fah/ws001 192.168.2.100/255.255.255.0 (rw,no_root_squash,sync)
/fah/ws002 192.168.2.100/255.255.255.0 (rw,no_root_squash,sync)

## LTS-end ##

 

The rc.local file is really long, however you will only need to make a few changes to the default config file so that you are mounting the proper folding directory. BE SURE TO MAKE A BACKUP OF THIS FILE BEFORE EDITING! Look below for the section that says "Mount file systems for the FAH client.", that part you will need to add in, and the other mounting part gets commented out. I also set the DEFAULT_SERVER here. Once you feel comfortable with the config file you can delete out other stuff that is not needed, since you are really only using a small portion of the file. I highlighted the changed part in red so you could find it easier.

/opt/ltsp/i386/etc/rc.local

#!/bin/sh
#
# rc.local
#
# This script will setup the environment
# for a diskless workstation, as part of
# the Linux Terminal Server Project (http://www.LTSP.org)
#
PATH=/bin:$PATH; export PATH
. /etc/ltsp_functions

/sbin/devfsd /dev

#
# Mount /proc before /tmp, so that we can display the progress
#
echo "Mounting /proc filesystem"
mount -n -t proc /proc /proc

#
# Un-mount the initrd, to free up some space
#
umount /oldroot >/dev/null 2>&1

#
# Get the runlevel for this workstation
#
RUNLEVEL=`get_cfg RUNLEVEL 5`

#
# Find out if we want to allow local applications
#

pr_set 67 "Checking for Local Apps"

LOCAL_APPS=`get_cfg LOCAL_APPS N`

if [ "${LOCAL_APPS}" = "Y" ]; then
if [ ! -d /home ]; then
pr_warn
echo
echo "WARNING! You have Local apps enabled in lts.conf, but"
echo " you don't have the local_apps package loaded"
echo " Local apps will be disabled."
echo
LOCAL_APPS="N"
fi
fi

#
# Find out if we want to swap via NFS
#
USE_NFS_SWAP=`get_cfg USE_NFS_SWAP N`

#
# Create and mount the ramdisk as the /tmp filesystem This
# is the only place we can write files, because everything else
# is read-only.
#

pr_set 69 "Creating Ramdisk"

echo "Creating ramdisk on /tmp"
RAMDISK_SIZE=`get_cfg RAMDISK_SIZE 1024`
/sbin/mke2fs -q -m0 /dev/ram1 ${RAMDISK_SIZE}
/bin/mount -n /dev/ram1 /tmp

pr_set 70 "Setting Hostname"

HOSTNAME=`hostname`
echo "Current hostname: ${HOSTNAME}"

#############################################################
# Get the IP address of the default server. This is used for
# XDM_SERVER,TELNET_HOST and SYSLOG_HOST if any of them are
# not set explicitly. Default to '192.168.0.254' if it is NOT
# set in the config file.
#
DEFAULT_SERVER=`get_cfg SERVER 192.168.2.100`

>/tmp/mtab

#############################################################
# Load some kernel modules
#

pr_set 71 "Loading Modules"

SERIAL_MOD_LOADED="N"
PARALLEL_MOD_LOADED="N"

KERNEL_VERSION=`cut -d " " -f3 /proc/version`
MODULE_DIR=/lib/modules

for i in 01 02 03 04 05 06 07 08 09 10; do
MODULE=`get_cfg MODULE_${i}`
if [ -n "${MODULE}" ]; then
if [ "${MODULE}" = "serial" ]; then
SERIAL_MOD_LOADED="Y"
fi
if [ "${MODULE}" = "lp" ]; then
PARALLEL_MOD_LOADED="Y"
fi
case "${MODULE}" in

/*) # If it starts with a slash, we use insmod
#
MODULE_PATH="${MODULE_DIR}/${KERNEL_VERSION}${MODULE}"
/sbin/insmod ${MODULE_PATH}
ERR=$?
if [ ${ERR} -ne 0 ]; then
pr_fail
echo
echo "ERROR! loading module: ${MODULE} failed !"
echo
echo -n "Press <enter> to continue "
read CMD
exit
fi
;;

*) # Otherwise, we use modprobe
#
echo "Loading: ${MODULE}"
/sbin/modprobe ${MODULE}
ERR=$?
if [ ${ERR} -ne 0 ]; then
pr_fail
echo
echo "ERROR! loading module: ${MODULE} failed !"
echo
echo -n "Press <enter> to continue "
read CMD
exit
fi
;;
esac
fi
done

################################################################
#
# Setup the resolv.conf file
#

pr_set 72 "Setting up resolv.conf"

SEARCH_DOMAIN=`get_cfg SEARCH_DOMAIN`
if [ "${SEARCH_DOMAIN}" != "" ]; then
echo "search ${SEARCH_DOMAIN}" >/tmp/resolv.conf
fi

DNS_SERVER=`get_cfg DNS_SERVER ${DEFAULT_SERVER}`
echo "nameserver ${DNS_SERVER}" >>/tmp/resolv.conf

NFS_SERVER=`get_cfg NFS_SERVER ${DEFAULT_SERVER}`

################################################################
#
# Setup swap
#
if [ "${USE_NFS_SWAP}" = "Y" ]; then
pr_set 73 "Checking for NFS swap"
modprobe nfsswap
mkdir /tmp/swapfiles
SWAPFILE=/tmp/swapfiles/${HOSTNAME}.swap
SWAP_SERVER=`get_cfg SWAP_SERVER ${NFS_SERVER}`
NFS_SWAPDIR=`get_cfg NFS_SWAPDIR /var/opt/ltsp`
pr_set 74 "Mounting swapfiles directory"
echo "Mounting swapfiles directory"
mount -t nfs -o rsize=2048,wsize=2048,nolock \
${SWAP_SERVER}:${NFS_SWAPDIR}/swapfiles \
/tmp/swapfiles
ERR=$?
if [ ${ERR} -ne 0 ]; then
pr_set 74 "Mounting of swap filesystem failed, err=${ERR}"
pr_fail
echo "Mounting of swap filesystem failed, err=${ERR}"
echo "Attempted to NFS mount ${SWAP_SERVER}:${LTSP_SWAPDIR}"
echo -n "Press <enter> to continue "
read CMD
exit
else
pr_set 75 "Preparing swapfile"
SWAPFILE_SIZE=`get_cfg SWAPFILE_SIZE 64m`
/sbin/prep_swap -s ${SWAPFILE_SIZE} -f ${SWAPFILE}
ERR=$?
if [ ${ERR} -ne 0 ]; then
pr_set 75 "Error creating swapfile, ERR=${ERR}"
pr_fail
echo "Error creating swapfile, ERR=${ERR}"
echo -n "Press <enter> to continue "
read CMD
exit
fi
pr_set 80 "Formatting Swapfile"
mkswap ${SWAPFILE}
ERR=$?
if [ ${ERR} -ne 0 ]; then
pr_set 80 "Error running mkswapswapfile, ERR=${ERR}"
pr_fail
echo "Error running mkswapswapfile, ERR=${ERR}"
echo -n "Press <enter> to continue "
read CMD
exit
fi
pr_set 83"Enabling swap via NFS"
echo "Enabling swap via NFS"
swapon ${SWAPFILE}
ERR=$?
if [ ${ERR} -ne 0 ]; then
pr_set 83 "swapon failed, ERR=${ERR}"
pr_fail
echo "swapon failed, ERR=${ERR}"
echo
echo "Are you sure the NFS/Swap patch has "
echo "been applied to the workstation kernel?"
echo
echo -n "Press <enter> to continue "
read CMD
exit
fi
fi
fi

##################################################################
#
# Mount filesystems for the FAH client.
# The stucture of the mount directory is
# /fah/name_of_workstation Eg /fah/ws001
# The mount point is the same for all workstations:
# /fah
#

if [ "Y" = "Y" ]; then
pr_set 85 "Mounting additional filesystems"
echo "Mounting additional filesystems..."
mount -t nfs -o nolock ${NFS_SERVER}:/fah/${HOSTNAME} /fah
fi

##################################################################
#
# Mount filesystems
#
#
# if [ "${LOCAL_APPS}" = "Y" ]; then
# pr_set 85 "Mounting additional filesystems"
# echo "Mounting additional filesystems..."
# mount -t nfs -o nolock ${NFS_SERVER}:/home /home
# fi

pr_set 86 "Setting up loopback device"
echo "Setting up loopback device"
ifconfig lo 127.0.0.1 netmask 255.0.0.0 broadcast 127.255.255.255

mkdir /tmp/compiled
mkdir /tmp/var
mkdir /tmp/var/run
mkdir /tmp/var/log
mkdir /tmp/var/lock
mkdir /tmp/var/lock/subsys
mkdir /tmp/var/lib
mkdir /tmp/var/lib/xkb
mkdir /tmp/mnt

################################################################
#
# Check the hostname
#

echo "127.0.0.1 localhost ${HOSTNAME}" >/tmp/hosts
echo "${DEFAULT_SERVER} server" >>/tmp/hosts

################################################################
#
# Setup the hosts.equiv file
#
echo "${DEFAULT_SERVER}" >/tmp/hosts.equiv

################################################################
#
# Start the syslog daemon
#
pr_set 88 "Starting syslogd"
SYSLOG_HOST=`get_cfg SYSLOG_HOST ${DEFAULT_SERVER}`
echo "Starting syslogd"
echo "*.* @${SYSLOG_HOST}" >/tmp/syslog.conf
syslogd -m 60 -R ${SYSLOG_HOST}

################################################################
#
# Local app daemon stuff
#
if [ "${LOCAL_APPS}" = "Y" ]; then
pr_set 90 "Starting Portmapper"
echo "Starting portmapper"
portmap

pr_set 91 "Starting xinetd"
echo "Starting xinetd"
xinetd

NIS_SERVER=`get_cfg NIS_SERVER`
if [ "${NIS_SERVER}" != "" ]; then
pr_set 92"Setting NIS server"
echo "Setting NIS Server"
echo "ypserver ${NIS_SERVER}" >>/etc/yp.conf
fi

pr_set 93 "Setting domainname"
echo "Setting domainname"
NIS_DOMAIN=`get_cfg NIS_DOMAIN "ltsp"`
echo domainname ${NIS_DOMAIN}
domainname ${NIS_DOMAIN}

pr_set 94 "Starting ypbind"
echo "Starting ypbind"
if [ -z "${NIS_SERVER}" ]; then
ypbind -broadcast
else
ypbind
fi

#
# Need to give ypbind a chance to bind to the server,
# hopefully this is long enough
#
sleep 1

fi

#################################################################
#
# Run the additional rc files.
# These are to make it easier to integrate additional
# functionality into an ltsp system. Add your scripts to etc/rc.d,
# and put the name of the script in the lts.conf file, and it will
# be executed.
#

pr_set 95 "Checking for rcfiles"
for i in 01 02 03 04 05 06 07 08 09 10; do
RCFILE=`get_cfg RCFILE_${i}`
if [ -n "${RCFILE}" ]; then
if [ -x /etc/rc.d/${RCFILE} ]; then
/etc/rc.d/${RCFILE}
else
pr_fail
echo
echo " ERROR: RCFILE_${i} is setup in lts.conf, but"
echo " it does not exist in the /etc/rc.d directory"
echo
echo -n "Press <enter> to continue "
read CMD
fi
fi
done

pr_set 100 "Completed"

 

 





EXTREME Overclocking Newsletter
Thousands of PC enthusiasts are already subscribed to the EXTREME Overclocking Newsletter, have you signed up yet?
Your Email Address:
Sponsored Links
Latest Reviews
Most Downloaded Files
Recently Added Files
CPU-Z 1.4912/12/08
Compare Prices On Top Brands!
Search:
For:

Intel Processors
Core i7 - Nehalem
965 Extreme  940  920

Core 2 Extreme - Yorkfield XE
QX9775  QX9770  QX9650

Core 2 Quad - Yorkfield
Q9650  Q9550  Q9400  Q9300  Q8300  Q8200

Core 2 Quad - Kentsfield
Q6600

Core 2 Duo - Wolfdale
E8600  E8500  E8400  E8200  E7300  E7200

AMD Processors
Phenom II X4
940 Black  920

Phenom X4
9950 Black  9850 Black  9750  9650

Phenom X3
8750  8650  8450

Athlon X2
7750 Black  6000+  5600+  5400+  5200+  5000+  5050e  4850e

Video Cards
nVidia GeForce GTX 200 Series
GTX 295  GTX 285  GTX 280  GTX 260

nVidia GeForce 9 Series
9800 GX2  9800 GTX+  9800 GTX  9800 GT  9600 GT  9600 GSO

ATI Radeon HD 4000 Series
4870 X2  4870  4850  4830  4670  4650

Search By Brand
ASUS  BFG  Diamond  eVGA  Gigabyte  HIS  MSI  Palit  PowerColor  PNY  Sapphire  Visiontek  XFX

PC Memory
DDR3  DDR2  DDR

Motherboards
ASUS  Biostar  DFI  ECS  eVGA  Foxconn  Gigabyte  Intel  MSI  Shuttle  Supermicro  Tyan  XFX

Hard Drives
Seagate  Maxtor  Samsung  Fujitsu  Western Digital

  Technology Magazines FREE to Qualified Professionals.
eWeek MagazineeWeek is the essential technology information source for builders of e-business. Focuses on e-commerce, communications and Internet-based architecture. Oracle MagazineOracle Magazine contains technology-strategy articles, sample code, tips, Oracle and partner news, how-to articles for developers and DBAs, and more. Dr. Dobb's JournalDr. Dobb's Journal enables programmers to write the most efficient and sophisticated programs and help in daily programming quandaries. InformationWeekInformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
  Other Popular Titles: PC Magazine, BusinessWeek, Baseline, Business Solutions, Software Magazine, InfoStor, Security Source , TelevisionWeek, more...
  EXTREME Deal Of The Day | More EXTREME Deals
Dell Small Business - Dell Vostro 220 Slim Tower Computer with Dual Core Processor, 2GB of Memory, 160GB Hard Drive and 18.5" LCD Monitor for Only $389!
Dell Vostro 220 Slim Tower ComputerYou get a 2.6GHz Intel Dual Core processor, 2GB of DDR2 SDRAM memory, 160GB SATA 7200rpm hard drive, DVDROM and Dell's E1910H 18.5" LCD monitor for just $389 after a $248 instant savings. You get the option of switching out the Norton for Trend Micro instead (which is DEFINITELY recommended) for the 15 month period and a 250GB hard drive is just $15. Windows 7 Home Premium 32bit comes with this system and you're all set to go for pretty much any home office, kids, school, work computing that you need to get done. DELL VOSTRO 220 SLIM TOWER COMPUTER WITH 18.5 INCH LCD MONITOR COMBO DEAL

Dell Financial Services - 33% Off Coupon for EVERYTHING!
Huge discount on their hot factory certified desktop computers and laptops. Stock is limited to whatever they've got in hand so grab it quick if you see what you want. Use coupon code: Save33PreHoliday (expires 11/9/09)

Copyright © 2000-2009 EXTREME Overclocking. All rights reserved.
Disclaimer of Liability - Privacy Policy