The finstall script
From FaHWiki
This page is based on finstallFAQ.txt.
Finstall Script Overview
If any Distributed Computing (DC) client wants to be successful, it should be possible to install it, start it and then forget about it - no babysitting nor manual tinkering.
Since the Folding@home (FAH) console client does not fill those requirements itself, there is a need for 3rd party utilities to fill the void. One of these is the finstall script.
In the basic setup, finstall will download the FAH client and set up as many FAH clients as there are CPUs. The whole process is simple and can be made automatic ("./finstall auto") - the only input needed from the user is the initial, one-time configuration.
The finstall script will generate all needed directories, files and additional scripts that will make it possible to check the status of any running FAH client ("./folding status"), install FAH as a service to be started on machine bootup ("./installService"), run the FAH clients manually ("./folding start", "./folding stop") or even run the FAH client(s) the "official way" inside the terminal window ("./FaH").
The finstall generated FAH service script have no graphical hooks to KDE, Gnome or whatever desktop environment you run, and all standard service management tools should be able to communicate with it as with any other service on your machine.
The finstall supports (almost) any sort of Unix out there (including MacOSX) and can even install the FAH Win32 console client for running in Wine.
finstall - installation
NOTE: All commands should be typed in to console. Either use the text only console or run xterm, konsole or other console emulation programs under graphical environment. The commands to be typed in are after the "$" sign.
Note2: Some illustrations about the finstall installation procedure are available at http://ra.vendomar.ee/%7Eivo/finstall_in_action.html
It should be easy. Just download the finstall script and start it.
Short version
curl -O http://ra.vendomar.ee/~ivo/finstall
chmod +x finstall
./finstall
Long version
1. Download the finstall http://ra.vendomar.ee/~ivo/finstall either with a browser or with wget/curl/...:
[xxxxx@xxxxxxxxxxx xxxxx]$ wget -c http://ra.vendomar.ee/~ivo/finstall
At least MacOSX has no wget, but has curl:
[xxxxx@xxxxxxxxxxx xxxxx]$ curl -O http://ra.vendomar.ee/~ivo/finstall
Note: This will place the finstall into the current directory you are in.
2. Make the script runnable:
[xxxxx@xxxxxxxxxxx xxxxx]$ chmod +x finstall
Note: The finstall script will install FAH client(s) with "runners" permissions. Running anything non-essential under ROOT account is bad practice by itself, make a dedicated user for FAH and start finstall over there.
3. Start it (with switches):
[xxxxx@xxxxxxxxxxx xxxxx]$ ./finstall
or
[xxxxx@xxxxxxxxxxx xxxxx]$ ./finstall freebsd
or
[xxxxx@xxxxxxxxxxx xxxxx]$ ./finstall wine
or
[xxxxx@xxxxxxxxxxx xxxxx]$ ./finstall gentoo
...
Note1: The ./finstall default behaviour is to set the FAH client up in "passive mode" so user will not have direct access to running FAH instance (for viewing the output or answering possible questions). To override this, use "./finstall screen" option. ( Example: http://folding-community.org/viewtopic.php?t=9537 )
Note2: On platforms (MACOSX & OpenBSD) where default shell is not BASH, You may need to start the ./finstall with:
[xxxxx@xxxxxxxxxxx xxxxx]$ bash -c "./finstall"
Attention: If the FAH is already running or You have installed the FAH "long time ago" and performing a FAH upgrade - You are not required to delete previous copy of ~/folding@home/..., only thing to do is to stop the running FAH and rename ~/folding@home/ to ~/foldingathome/, before You run ./finstall:
[xxxxx@xxxxxxxxxxx xxxxx]$ ./finstall
This is FAH ("Folding At Home") installation script (ver. 2.7).
To get to know more about FAH, go to http://folding.stanford.edu .
Testing the availability of external utils...
...done.
Using flags:
nofetch: false nomd5: false copycfg: false
keepcfg: false norun: false no3rd: false
freebsd: false wine: false skip3rd: false
fcliA: false fcliB: true nodocs: false
get3rd: false setid: false keepid: false
auto: false screen: false noscreen: true
samba: false macosx: false linux: true
setcfg: false openbsd: false
Setting up FAH client(s) for 1 processor(s).
Directory /home/xxxxx/foldingathome is present...
---Documentation---
Downloading finstall FAQ:
--00:46:03-- http://ra.vendomar.ee/%7Eivo/finstallFAQ.txt
=> `finstallFAQ.txt'
Resolving ra.vendomar.ee... done.
Connecting to ra.vendomar.ee[194.204.4.34]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16,673 [text/plain]
100%[==============================================>] 16,673 301.52K/s
ETA 00:00
00:46:04 (301.52 KB/s) - `finstallFAQ.txt' saved [16673/16673]
Downloading general FAH on Linux HOWTO:
--00:46:06-- http://ra.vendomar.ee/%7Eivo/FAHLinux.txt
=> `FAHLinux.txt'
Resolving ra.vendomar.ee... done.
Connecting to ra.vendomar.ee[194.204.4.34]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 23,793 [text/plain]
100%[==============================================>] 23,793 255.33K/s
ETA 00:00
00:46:06 (255.33 KB/s) - `FAHLinux.txt' saved [23793/23793]
Do You want to read finstall FAQ (yes/no)?:n
Creating folding startup script...
...folding startup script created.
Installation terminated as FAH is currently running from
/home/xxxxx/foldingathome !
Terminate FAH and run ./finstall again.
[xxxxx@xxxxxxxxxxx xxxxx]$
4. and follow the instructions...
5. To get FAH client(s) going there are couple of ways - either use ./foldingathome/CPUx/FaH script(s) directly, use "/home/xxxxx/foldingathome/folding start" to start FAH by hand or set up it as a (bootup) service (FAH as a service).
Upgrading existing FAH clients to "finstall format"
To move any existing FAH client setups over to "finstall format":
1. Stop all running FAH clients;
2. Make a "foldingathome" directory to Your homedirectory;
3. Make as many CPU# subdirectories (ex. if You have 1 FAH client then
subdirectory CPU1 if just fine, but if there are 4 FAH clients then make
CPU1, CPU2, CPU3 and CPU4 named subdirectories) into this foldingathome
directory as the FAH clients are You running on this system;
4. Move the old FAH clients directory contents one by one over to these
CPU1...CPUn directories;
5. Change the ownership of the files to avoid permission errors;
6. Download finstall, add execution rights to it and fire it up;
7. After answering some questions, You can install FAH as service
("./foldingathome/installService") or start it manually
("./foldingathome/folding start") or ...;
Example from http://folding-community.org/viewtopic.php?p=93096#93096:
mkdir ~/foldingathome
mkdir ~/foldingathome/CPU1
cp -r WHERE_IS_THE_FAH_NOW ~/foldingathome/CPU1
rm -r WHERE_IS_THE_FAH_NOW
chown -R THIS_USER.THIS_GROUP ~/foldingathome
curl -O http://ra.vendomar.ee/~ivo/finstall
chmod +x ./finstall
./finstall
Note: Be careful with the "rm". If You type it wrong then it may delete something different You intended. All this moving and copying is easily done with the Midnigh Commander (mc).
Finstall - folding start/stop
After the client is installed You can start/stop/... it with ~/foldingathome/folding script
EG...
~/foldingathome/folding start
~/foldingathome/folding stop
Typical use:
login as: xxxxx
Sent username "xxxxx"
xxxxx@xxxxxxxxxxx's password:
Last login: Tue Aug 5 01:45:33 2003 from xxx.xxx.x.xx
[xxxxx@xxxxxxxxxxx xxxxx]$ cd ./foldingathome
[xxxxx@xxxxxxxxxxx foldingathome]$ ./folding start
['folding' ver. 2.7]
Starting up FAH client(s) on 1 processor(s):
Starting FAH client at CPU1...
FAH client #1 startup: OK
Starting of FAH client(s): OK
[xxxxx@xxxxxxxxxxx foldingathome]$
[xxxxx@xxxxxxxxxxx foldingathome]$ ./folding stop
['folding' ver. 2.7]
Stopping of FAH client(s):
Phase #1
Sending 'End_Your_Work' signal (kill -15) to following Core PIDs: 2225 2224
2223
Waiting 17 seconds for FAH client(s) to end working...
-=*=-=*=-=*=-=*=-
No fahclients running...
Phase #2
No FAH Cores running...
No fahclients running...
Stopping of FAH client(s): OK
[xxxxx@xxxxxxxxxxx foldingathome]$
You can skip the phase #1 of the "stopping" if to add "force" option, but it is not advicable as it will kill FAH without giving it any time to finish its job normal way.
Note: If Your box (computer) has multiple CPUs or You somehow want to specify some particular instance of FAH clients - You can add a CPU-named subdirectory number or "dirs"/"cpus" ("cpus" & "dirs") to folding "start"/"stop" option:
[xxxxx@xxxxxxxxxxx foldingathome]$ ./folding start 2
There is also a "restart" option. It is "stop" and "start" combined:
[xxxxx@xxxxxxxxxxx foldingathome]$ ./folding restart
['folding' ver. 2.7]
Restarting of FAH client(s):
Step #1
Stopping of FAH client(s):
Phase #1
Sending 'End_Your_Work' signal (kill -15) to following Core PIDs: 28007
28006 28005
Waiting 17 seconds for FAH client(s) to end working...
-=*=-=*=-=*=-=*=-
No fahclients running...
Phase #2
No FAH Cores running...
No fahclients running...
Step #2
Starting FAH client at CPU1...
FAH client #1 startup: OK
Restarting of FAH client(s): OK
[xxxxx@xxxxxxxxxxx foldingathome]$
To start the FAH client(s) during system startup or more automatic way then read "[folding as a service]" paragraph below.
folding status options
./folding status - will show status of proccesses named "FaH", "fahclient*",
and "*Core_*.exe".
Note: "*" of "fahclient*" is numbered by "dirs" ("cpus" & "dirs") and Core
file names are from these CPU-named subdirectories.
If you use plain "status", there will be no process identification per
CPU-named subdirectories and no FAH WU status will be reported.
To get the status of FAH WUs, you must add a CPU-named subdirectory number
or ("cpus" & "dirs") option.
./folding status dirs - will show the status of all CPU-named
subdirectories.
./folding status 1 - will show the status of CPU1.
./folding status 2 - will show the status of CPU2.
./folding status 3 - will show the status of CPU3.
./folding status 4 - will show the status of CPU4.
etc...
Typical use:
[xxxxx@xxxxxxxxxxx foldingathome]$ ./folding status 1
['folding' ver. 2.7]
Status of running FAH client(s) on 1 processor(s):
Status on all possible 'FaH' scripts:
FaH (pid 2378) is running
Status on all possible fahclient's:
fahclient1 (pid 2405 2404 2403 2402 2379) is running
Status on all possible Cores (FahCore_65.exe):
FahCore_65.exe (pid 2408 2407 2406) is running
Processes running from /xxxxx/foldingathome/CPU1 directory:
FaH pids: 2378
fahclient pids: 2405 2404 2403 2402 2379
FAH Core pids: 2408 2407 2406
FAH client flags: '-verbosity 9'
Index 1: folding now (1.394 pt/hr) 23.6 X min speed; 63.2% complete
server: 171.64.122.143:8080; project: 638, "p638_L939_K12M_ext"
Folding: run 250, clone 74, generation 7; benchmark 1476; misc: 500, 200
issue: Sun Aug 3 17:46:58 2003; begin: Sun Aug 3 17:44:10 2003
expect: Tue Aug 5 20:35:15 2003; due: Mon Sep 22 17:44:10 2003 (50 days)
core URL: http://www.stanford.edu/~pande/Linux/x86/Core_65.fah
user: MstrBlstr; team: 4; ID: 794540A35A7C9570; mach ID: 1
work/wudata_01.dat file size: 23469; WU type: Folding@Home
Annual score benchmark: 12222
Status of FAH client(s): OK
[xxxxx@xxxxxxxxxxx foldingathome]$
The "Index 1:..." will only be there if you allowed finstall to install
the "qd" third party app (3rd party tools).
If you did not allow the qd to install, it will show you the unitinfo.txt
output instead.
Current Work Unit
-----------------
Name: p363_tip4p_pf2_Mg
Download time: August 4 15:58:59
Due time: September 9 15:58:59
Progress: 70% [|||||||___]
To get last 10 lines of FAHlog.txt, add "viewlog":
[xxxxx@xxxxxxxxxxx foldingathome]$ ./folding status dirs viewlog
folding as a service
Add to the bottom of Your distro bootup file (under Mandrake - rc.boot; SuSe - boot.local; RedHat - rc.local; ...) following lines:
cd Where_I_installed_the_FAH
./folding start
Note: "Where_I_installed_the_FAH" is usually under foldingathome subdirectory
of Your homedirectory.
Example:
Under one of my box I installed the FAH as user xxxxx, so folding script is
under /home/xxxxx/foldingathome/ directory:
[xxxxx@xxxxxxxxxxx foldingathome]$ ls
CPU1 FAH4Console-Linux.exe folding
[xxxxx@xxxxxxxxxxx foldingathome]$
and lines at the end of /etc/rc.d/rc.local are:
#FAH
cd /home/xxxxx/foldingathome
./folding start
If You distribution support SysV startup scripts (at least RedHat does it)
then there is another way to run FAH as a service:
1. Copy /home/xxxxx/foldingathome/folding to /etc/init.d/ (only root
user can carry out this operation);
2. Run "chkconfig --add folding" or enable "folding" with some service
manager;
[xxxxx@xxxxxxxxxxx foldingathome]$ su -
Password:
[root@xxxxxxxxxxx root]$ cp /home/home/xxxxx/foldingathome/folding
/etc/rc.d/init.d
[root@xxxxxxxxxxx root]$ chkconfig --add folding
[root@xxxxxxxxxxx root]$ exit
[xxxxx@xxxxxxxxxxx foldingathome]$
No additional /etc/rc.d/rc.* file modification should be needed.
Note1: There is ~/foldingathome/installService script what will implement the
"service install" procedure. The script is different for platforms, verify
and run it if You want to use the "service adding" procedures.
Note2: To upgrade only the folding script You even haven't stop the FAH
clients. Just download newer finstall and start it. Even if it will stop and
complain as FAH already running, it has extracted new folding script. It is
easy to start ./foldingathome/installService and reinstall the new folding
script over old one.
Methods described earlier required a ROOT permissions, but if to use
CRONTAB, You need not be ROOT. "@reboot" method is described over:
http://teammacosx.homeunix.com/forum/cgi-bin/ikonboard.pl?s=630986ed363be3092a8737a56af58b87;act=ST;f=10;t=173
Short "crontab" howto:
Start "crontab -e", press "i",
add "@reboot /home/xxxxx/foldingathome/folding start >/dev/null"
to the end of file, press [Esc] key, type ":x" and press [Enter].
Note: You may need to add some other parameters to the crontab as well.
Fore more information look at
http://folding-community.org/viewtopic.php?p=77898#77898
Attention: You should NEVER run FAH or any (resident) program on computer You
have no permissions to do so. If nothing else then this is unethical and at
worst case You will get fined/jailed for stealing (computing) time and
resources.
folding - usage of "cpus" and "dirs" options
Options "cpus" and "dirs" are functions of folding script what will specify
to what ./foldingathome/ CPU-named subdirectories to carry out the main
function ("start", "stop", "restart" or "status").
"cpus" option will count detected CPUs.
If Your box has 4 CPUs then it will force finstall/folding to use
directories CPU1, CPU2, CPU3 and CPU4.
"dirs" option will detect ./foldingathome/ CPU-named subdirectory numbers.
You can make unlimited number of CPU subdirectories:
[[xxxxx@xxxxxxxxxxx foldingathome]$ mkdir CPU1 CPU100 CPU3 CPU4
[[xxxxx@xxxxxxxxxxx foldingathome]$ ls
CPU1 CPU100 CPU3 CPU4
[[xxxxx@xxxxxxxxxxx foldingathome]$
In this setup "dirs" will force finstall/folding to use directories CPU1,
CPU100, CPU3 and CPU4.
"dirs" option will relay to "cpus" functionality when no CPU-named
subdirectories are found.
Note: finstall script will always relay on "dirs" and by "dirs" definition,
finstall will always carry out an update, not a fresh install (unless it is
a first install of the FAH).
3rd party FAH tools
Starting with "finstall" version 1.9 it is possible to let "finstall"
download and use Dick Howell's "qd" and "fpd" (qd/fpd at
http://linuxminded.xs4all.nl/mirror/www.boston.quik.com/rph/fah.html).
"qd" is for showing the status of the WUs and "fpd" is X11 util for showing
the protein itself (requires a X server at viewers side and one great thing
- it is working over ssh session just fine).
There is no special flags needed to get "qd" printout from "folding" - if there is "qd" executable/symlink to "qd" executable in CPU-named directory then it will be used:
[xxxxx@xxxxxxxxxxx foldingathome]$ ./folding status dirs
['folding' ver. 2.7]
Status of running FAH client(s) on 1 processor(s):
Status on all possible 'FaH' scripts:
FaH (pid 2378) is running
Status on all possible fahclient's:
fahclient1 (pid 2405 2404 2403 2402 2379) is running
Status on all possible Cores (FahCore_65.exe):
FahCore_65.exe (pid 2408 2407 2406) is running
Processes running from /xxxxx/foldingathome/CPU1 directory:
FaH pids: 2378
fahclient pids: 2405 2404 2403 2402 2379
FAH Core pids: 2408 2407 2406
FAH client flags: '-verbosity 9'
Index 1: folding now (1.394 pt/hr) 23.6 X min speed; 63.2% complete
server: 171.64.122.143:8080; project: 638, "p638_L939_K12M_ext"
Folding: run 250, clone 74, generation 7; benchmark 1476; misc: 500, 200
issue: Sun Aug 3 17:46:58 2003; begin: Sun Aug 3 17:44:10 2003
expect: Tue Aug 5 20:35:15 2003; due: Mon Sep 22 17:44:10 2003 (50 days)
core URL: http://www.stanford.edu/~pande/Linux/x86/Core_65.fah
user: MstrBlstr; team: 4; ID: 794540A35A7C9570; mach ID: 1
work/wudata_01.dat file size: 23469; WU type: Folding@Home
Annual score benchmark: 12222
Status of FAH client(s): OK
[xxxxx@xxxxxxxxxxx foldingathome]$
Note: To not to use "qd", even if it is available, use "noqd":
[xxxxx@xxxxxxxxxxx foldingathome]$ ./folding status cpus noqd
To get "fpd" going:
[xxxxx@xxxxxxxxxxx foldingathome]$ ./folding status 1 fpd
Note: It will work only if there is "fpd" executable/symlink to "fpd" executable in CPU-named directory.
If You want to force downloading 3rd party FAH tools then use "get3rd":
[xxxxx@xxxxxxxxxxx xxxxx]$ ./finstall get3rd
If You do not want to be asked about nor download (but still use if already downloaded) any 3rd party FAH tools then use "skip3rd":
[xxxxx@xxxxxxxxxxx xxxxx]$ ./finstall skip3rd
If You do not want to use any 3rd party FAH tools then use "no3rd":
[xxxxx@xxxxxxxxxxx xxxxx]$ ./finstall no3rd
finstall - automation (finstall options)
It is possible to use "finstall" without human intervention (*).
(*) At current state the only truly needed input from user is the
"first-time-run-for-config-typing" of FAH client.
Available "finstall" options for automation:
1) "nofetch" - will deny all download operations by ./finstall.
"FAH3Console" and any 3rd party tool You want to use must be in
"foldingathome" directory.
2) "nomd5" - no "FAH3Console" MD5 checkings (MD5 values are at FAH Client
Download Page), the FAH client will be deleted and forced to be downloaded
again (except when used with "nofetch" or there is no wget available on that
system).
3) "norun" - "FAH3Console" will not be runned even there is a need for
"first-time-run-for-config-typing". Despite user choices, there must be
client.cfg file for a FAH client and it will ask for it...
4) "keepcfg" - no attempts will be made to run FAH client if there is
client.cfg file already present.
5) "copycfg" - "finstall" will copy first suitable client.cfg file to
remaining FAH client directories.
6) "no3rd" - no 3rd party tools will be downloaded nor used by "folding"
script and all symlinks to "qd"/"fpd" (3rd party tools) will be removed from
FAH client (CPUx) directories.
7) "freebsd" - use it if You want to use the FAH client under FreeBSD.
8) "wine" - will download and install Win32 version of the FAH client.
9) "skip3rd" - use it if You have 3rd party tools (3rd party tools) already
downloaded and do not want to or can't update these.
10) "fcliA" and "fcliB" - These options are obsolete as there is now only one
version of FAH Linux client.
11) "nodocs" - Use "nodocs" if You already have read finstallFAQ.txt ro do
not want to be asked about it.
12) "get3rd" - Use "get3rd" to force downloading of 3rd party FAH utilities.
13) "setid" - Use "setid" to set client.cfg "machineid" to unique value. It
is not possible to have more than 4 FAH clients in one foldingathome
directory or (when using Wine) under the same user.
14) "keepid" - Use "keepid" to prevent MachineID changing even it may be
needed (useful when upgrading).
15) "auto" - Use "auto" to run ./finstall in "no questions asked" mode.
Note: Until there is no implemention of automatic generating of client.cfg
file, use it only when upgrading previous FAH installation(s).
16) "screen" and "noscreen" - Use "screen" if You would like to check FAH
client console output and need interactive access to it.
Note: When using 'screen' use "screen -r" to get output of some running FAH
client(s) and use CRTL+A+D to rehide it again.
"noscreen" will disable the usage of 'screen' utility (used by default).
17) "samba" - Use "samba" if You would like to use "SAMBA share adding
script" ./finstallSamba.
Note: ./finstallSamba can be run only by root user as other users do not
have access to /etc/samba/smb.conf.
18) "macosx" - Target platform is MACOSX.
19) "linux" - Target platform is Linux. If the platform detection is unable
to detect MACOSX nor OpenBSD then the target will be set as Linux.
20) "setcfg" - Will force the reconfiguration of the client(s).
21) "openbsd" - This option will extract the brandelf script and will set
the Linux FAH client up for OpenBSD. Read more at http://www.schnarff.com/fah.html
22) "gentoo" - As Gentoo has somewhat different ways to service install, use
this when running finstall on Gentoo.
23) "debug" - Turn on BASH debug trace.
Kranki2 wrote:
The "debug" turns on the bash trace mechanism when it is executed.
So, if I input "./finstall macosx no3rd smp debug dirs 4", bash shows me
every statement and result of that statement for processing the 'dirs 4' and
beyond. In the old days of IBM's CICS, you only had a trace table as a
debugging guide and I just learned to use tracing for debugging. It is
pretty handy for you because a user can specify "debug" and send you the
output so that you can see what happened.
24) "smp" - This option will get you a SMP FAH client.
25) "dirs" - This option will let you specify how many FAH clients you want
to install.
folding - FAH client flags
Because the "stock" FAH client behaviour without any flags MUST be adequate
enough for any "beginner" FAH donator, the finstall script itself will set
no additional FAH flags (only exception is "-verbosity 9").
To more knowledged FAH donators there is a ~/foldingathome/fah_config file
where You can add all required FAH flags (ex. FAH_flags="-advmethods
-forceasm -forceSSE").
Btw: the bfinstall script does set "-advmethods -forceasm -forceSSE" by
itself, but as it is a BETA FAH installation script and FAH donator MUST be
somewhat more involved to FAH before she/he starts using any beta FAH
clients.
The "FaH" script is the one what will run the FAH console, if there is a
need to add/remove some FAH console flags then You either modify
FAH_default_flags variable or act according to instructions contained inside
"FaH" script:
#!/bin/bash
#
# This is FAH (folding.stanford.edu) client startup file.
# (My) FAH client documentation:
# http://ra.vendomar.ee/~ivo/FAHLinux.txt
#
# (Optional) FAH client flags can be set in 3 separate files or/and by
setting
# environment variable 'FAH_flags'.
# ./FaH will run these files before it will start FAH client:
# 1. File 'fah_config' inside user/donator home directory;
# 2. File 'fah_config' inside foldingathome directory;
# 3. File 'fah_config' inside CPU directory;
#
# If the file 'fah_config' is present, it will be started and only thing it
# should do is to modify 'FAH_flags' variable to its likings.
#
# Every one of these files can override previous 'FAH_flags' value and
# set it's own. This is making possible to set per CPU based FAH flags.
# The easiest way to set FAH client flags is to:
# [user@machine user]$ cd
# [user@machine user]$ echo 'FAH_flags="myflags"' > fah_config
#
# "myflags" must be legal FAH client flags. To get these flags run
# ./FaH -?
# or/and read FAH client documentation.
#
# Note: If there are any arguments given to ./FaH then the FAH client will
# be run only with these as a FAH client flag(s) and all other ways of
# configuration will be ignored.
#
#Set 'FAH_default_flags' to FAH client flags You want to be used every time.
#Note: You can not override these flags with any method...
FAH_default_flags="-verbosity 9"
add_pref=""
cd /home/xxxxx/foldingathome/CPU1/
if [ "$1" = "" ];
then
if [ -r ~/fah_config ];
then
#Import 'fah_config' in user home directory:
. ~/fah_config
fi
if [ -r ../fah_config ];
then
#Import 'fah_config' in folding@home directory:
. ../fah_config
fi
if [ -r ./fah_config ];
then
#Import 'fah_config' in CPU directory:
. ./fah_config
fi
else
FAH_flags=""
add_pref=""
fi
echo ""
echo "Starting FAH..."
echo ""
$add_pref /home/xxxxx/foldingathome/CPU1/fahclient1 $FAH_flags $FAH_default_flags $@
"wine" version of the last line:
$add_pref nice -19 wine -- /home/xxxxx/foldingathome/CPU1/fahclient1
$FAH_flags $FAH_default_flags -local $@
"freebsd" version of the last line:
$add_pref /home/xxxxx/foldingathome/CPU1/fahclient1 $FAH_flags
$FAH_default_flags -freeBSD $@
Note1: The "FaH" script is in the CPU# directories.
Note2: "$add_pref" is there for "screen" util. If to use "screen" option
of ./finstall, the $add_pref will be set to "screen -dmS FAHx".
Also, You can run the ./FaH script directly with additional flags and
without a need to modify it:
[xxxxx@xxxxxxxxxxx CPU1]$ ./FaH -config
finstall internationalization
With finstall ver. 3.2 (all text output functions were put to their
dedicated functions) it became "relatively" easy to translate the finstall
screen output to other languages.
Minimally the http://ra.vendomar.ee/~ivo/finstall.lang file should be
translated to get the finstall to "communicate" in any new language, but
there are also two template scripts for the same purpose:
http://ra.vendomar.ee/~ivo/finstall.uk
http://ra.vendomar.ee/~ivo/bfinstall.uk
If nothing more then I've made a Estonian translation:
http://ra.vendomar.ee/~ivo/finstall.ee
http://ra.vendomar.ee/~ivo/bfinstall.ee
Developers guide to finstall & folding scripts
Under this section I will try to explain the design and buildup of finstall
and folding script so it should be possible to use functions of these in other scripts.
Easiest way to use finstall by "outside" scripts is to call it:
./finstall auto
and You'll get the finstall to install FAH client for You, but there is lot more what can be done with it...
The buildup of simplest external script should follow these steps:
1. Verify there is a finstall script around;
if [ -r finstall ];
then
#
# Your own code here
#
else
echo "No finstall!"
fi
2. "Import" finstall;
. finstall DoNothing >/dev/null
Note: The same "import" instructions will work with ./folding as well.
3. Redefine finstall functions and change parameters;
FAH_Settings(){
#
# Your own code here
#
}
...
4. Verify the version of finstall;
if [ $(echo $FAH_Install_Version | wc -w) -eq 0 ] ;
then
echo
echo "'finstall' is pre1.2!"
echo
else
if [ $FAH_Install_Version = $My_version ];
then
#
# Your own code here
#
else
echo
echo "'finstall' is not compatible."
echo
fi
fi
Note: My_version is the version of finstall You have verified to work with Your script.
5. Use finstall functions;
FAH_Install
There is a bfinstall script what is using the very same pattern to download and set up the FAH beta client.
bfinstall 2.9:
#!/bin/bash
BFAH_Install_Version="2.9"
# This is BETA FAH ("Folding At Home") installation script.
# To get to know more about FAH go to http://folding.stanford.edu.
#
# To run this script You should download bfinstall & finstall and use
command
# 'chmod +x bfinstall finstall; ./bfinstall' or if the default shell is not
# Bash, use 'chmod +x bfinstall finstall; bash -c "./bfinstall"'.
#
# Read ./finstall to get to know what it is all about.
#
# Send Your comments, help and suggestions to ivo at vendomar.ee.
#
Arguments=$@
if [ -r $PWD/finstall ];
then
#Import 'finstall':
. $PWD/finstall DoNothing
else
echo "There is no 'finstall' script in '"$PWD"' directory."
exit 1
fi
#Redefine some functions to make these "BETA" compatible...
#Where to get FAH console client & where to place it:
FAH_Settings(){
#FAH directory:
Fdir=foldingathome
##Latest FAH BETA client:
#Fclient_linuxA=FAH4.00-Linux-Pre2.exe
#Fclient_linuxB=FAH4.00-Linux-Pre2.exe
#Fclient_win32=FAH4.00-Console-Pre2.exe
#Fclient_macosx=FAH3Console-OSX.tgz
#Fclient_macosx_name=OSX-3.25
#Fdwnl=http://www.stanford.edu/group/pandegroup/release/beta/
#FdownWeb=http://www.stanford.edu/group/pandegroup/folding/beta/beta.html
#Latest FAH client:
Fclient_linuxA=FAH4Console-Linux.exe
Fclient_linuxB=FAH4Console-Linux.exe
Fclient_win32=FAH4Console.exe
Fclient_macosx=FAH4-CLI.dmg
Fclient_macosx_volume_name=FAH4-CLI
Fclient_macosx_name=fah4
Fdwnl=http://www.stanford.edu/group/pandegroup/release/
FdownWeb=http://folding.stanford.edu/download.html
FAH_default_flags="-verbosity 9"
}
FAH_Install_Greetings() {
echo
echo ' This is BETA FAH ("Folding At Home") installation script (ver.
'$BFAH_Install_Version').'
echo " To get to know more about FAH, go to http://folding.stanford.edu ."
echo
}
if [ $(echo $FAH_Install_Version | wc -w) -eq 0 ] ;
then
echo
echo "'finstall' is pre1.2!"
echo
else
if [ $BFAH_Install_Version = $FAH_Install_Version ];
then
CheckArg $Arguments
if [ $? -eq 0 ];
then
if [ "$DoNothing" != "true" ];
then
#Install BETA FAH client:
FAH_Install
if [ $? -eq 0 ];
then
#Set some FAH "flags":
cd $Fdir
if [ -r ./fah_config ];
then
#Flags are already there, do not update these:
echo -n
else
echo 'FAH_flags="-advmethods -forceasm -forceSSE"' > ./fah_config
fi
fi
fi
fi
else
echo
echo "'finstall' and 'bfinstall' are incompatible."
echo
fi
fi
#END.
The actual finstall function arsenal is larger than just a FAH_Install and CheckArg used by bfinstall. These functions are mainly FAH_Install subfunctions, check the finstall script itself for detailed instructions.
Notes
Ubuntu
http://folding-community.org/viewtopic.php?p=143406#143406
By smoking2000:
With the first account created on my Kubuntu system and using the below procedure, works just fine. This account is in the admin group.
Installation Procedure:
cd software/folding
wget http://ra.vendomar.ee/%7Eivo/finstall
chmod u+x finstall
./finstall
cd ~/foldingathome/
./folding start
This works as expected, just like for the other Linux distros.
When you want to install the folding script as a service, usage of sudo is required.
If the user running installService is not root, the command `su - -c "$(ServiceInstall)"` is not allowed.
You'll be propted for a password, but whatever you enter will be invalid, because the password of the root user is disabled. (See `man sudo_root` on any Ubuntu system` or https://help.ubuntu.com/community/RootSudo)
The correct way to use installService on Ubuntu systems is with sudo, like below.
Installation Procedure - Installing As Service:
sudo ./installService
sudo /etc/init.d/folding start
This works as expected. Because installService is run with root priviledges, the usage of su is allowed.
The usage of sudo to run the init script could be skipped, because sudo caches the password for 15 minutes so subsequent invokations of sudo don't require you to re-enter your password each time.
When trying to use installService in one way or the other, under a useraccount which is not in the admin group, you can forget about installing as a service. Only the user himself can run the folding script in ~/foldingathome/, either by hand or through crontab.
Since finstall version 4.9, sudo is automatically envoked when it is run on an Ubuntu system. The above caveat with installService and its usage of su only applies to finstall versions before 4.9.
Categories: ThirdParty | Linux | HOWTO

