updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / fah / fahpatch_6.02.diff
blob901e55ab35afa100fba939a85a1f1ef841030dbc
1 diff -Naur blank/fah.conf.d 6.02-1/fah.conf.d
2 --- blank/fah.conf.d 1969-12-31 16:00:00.000000000 -0800
3 +++ 6.02-1/fah.conf.d 2008-08-21 16:59:05.000000000 -0700
4 @@ -0,0 +1,12 @@
5 +#
6 +# Optional user settings for foldingathome daemon
7 +#
8 +# If you prefer not to run fah as root then you can identifer a current or
9 +# specially created user here.
11 +FAH_USER=""
13 +# If you wish to associate this user with a specific group you can enter the
14 +# group name here. If left blank the default is "users".
16 +FAH_GRP=""
17 diff -Naur blank/fah.license 6.02-1/fah.license
18 --- blank/fah.license 1969-12-31 16:00:00.000000000 -0800
19 +++ 6.02-1/fah.license 2008-08-21 16:59:27.000000000 -0700
20 @@ -0,0 +1,26 @@
21 +Folding@Home distributed computing client
22 +Copyright 2001-2007. Stanford University. All Rights Reserved.
24 +License Agreement:
26 +Please carefully read the following terms and conditions before using this software. Use of this software
27 +indicates acceptance of this license agreement and disclaimer of all warranties.
29 +Disclaimer of Warranty:
31 +IN NO EVENT SHALL STANFORD UNIVERSITY BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL,
32 +OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
33 +DOCUMENTATION, EVEN IF STANFORD UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 +STANFORD UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOTLIMITED TO, THE IMPLIED
35 +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING
36 +DOCUMENTATION PROVIDED HEREUNDER IS PROVIDED "AS IS". Folding@home HAS NO OBLIGATION TO PROVIDE
37 +MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
39 +Restrictions:
41 +You may use this software on a computer system only if you own the system or have the permission of the owner.
42 +You may not alter the software or associated data files.
43 +You may only use unmodified versions of Folding@home obtained through authorized distributors to connect
44 +to the Folding@Home servers. Use of other software to connect to the Folding@home servers is strictly prohibited.
45 +Distribution of this software is prohibited. It may only be obtained by downloading from Stanford's web site
46 +(http://folding.stanford.edu and pages linked therein) or the web site of one of our commercial partners (Sony, NVIDIA, and ATI).
47 diff -Naur blank/fah.rc.d 6.02-1/fah.rc.d
48 --- blank/fah.rc.d 1969-12-31 16:00:00.000000000 -0800
49 +++ 6.02-1/fah.rc.d 2008-08-21 17:00:48.000000000 -0700
50 @@ -0,0 +1,62 @@
51 +#!/bin/bash
52 +#/etc/rc.d/fah
54 +# Starts the Folding@Home client in the background
56 +. /etc/rc.conf
57 +. /etc/rc.d/functions
58 +. /etc/conf.d/fah
60 +PID=`pidof -o %PPID /opt/fah/fah6`
61 +case "$1" in
62 + start)
63 + stat_busy "Starting Folding@Home"
64 + if [ -z "$PID" ]; then
65 + if [ ! -z "$FAH_USER" ] ; then
66 + if [ ! -d "/opt/fah/$FAH_USER" ] ; then
67 + mkdir /opt/fah/$FAH_USER
68 + chown $FAH_USER /opt/fah/$FAH_USER
69 + if [ ! -z "$FAH_GRP" ] ; then
70 + chgrp $FAH_GRP /opt/fah/$FAH_USER
71 + else
72 + chgrp users /opt/fah/$FAH_USER
73 + fi
74 + touch /opt/fah/$FAH_USER/client.cfg
75 + fi
76 + cat /opt/fah/client.cfg > /opt/fah/$FAH_USER/client.cfg
77 + cd /opt/fah/$FAH_USER
78 + su $FAH_USER -c "nice --adjustment 19 /opt/fah/fah6 -verbosity 9 > /opt/fah/$FAH_USER/myfah.log" &
79 + else
80 + cd /opt/fah
81 + nice --adjustment 19 /opt/fah/fah6 -verbosity 9 > /opt/fah/myfah.log &
82 + fi
83 + fi
84 + if [ ! -z "$PID" -o $? -gt 0 ]; then
85 + stat_fail
86 + else
87 + add_daemon fah
88 + stat_done
89 + fi
90 + ;;
92 + stop)
93 + stat_busy "Stopping Folding@Home"
94 + [ ! -z "$PID" ]&& kill $PID &> /dev/null
95 + if [ $? -gt 0 ]; then
96 + stat_fail
97 + else
98 + rm_daemon fah
99 + stat_done
100 + fi
101 + ;;
103 + restart)
104 + $0 stop
105 + sleep 1
106 + $0 start
107 + ;;
109 + *)
110 + echo $"Usage: $0 {start|stop|restart}"
111 +esac