Gentoo Archives: gentoo-commits

From: "Tomas Chvatal (scarabeus)" <scarabeus@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-misc/boinc/files: boinc.init boinc.conf 08_all_Makefile.patch boinc-5.10.45-gcc4.3.patch boinc-6.2.15-mute-warnings.patch boinc-5.2.14-gcc-4.1.patch boinc-4.72.20050813-gcc4-fix.patch gui_rpc_auth.cfg boinc-6.2.15-project-list-size.patch
Date: Sat, 31 Jan 2009 15:19:38
Message-Id: E1LTHdA-0002jO-Fi@stork.gentoo.org
1 scarabeus 09/01/31 15:19:36
2
3 Modified: boinc.init boinc.conf
4 Removed: 08_all_Makefile.patch boinc-5.10.45-gcc4.3.patch
5 boinc-6.2.15-mute-warnings.patch
6 boinc-5.2.14-gcc-4.1.patch
7 boinc-4.72.20050813-gcc4-fix.patch gui_rpc_auth.cfg
8 boinc-6.2.15-project-list-size.patch
9 Log:
10 Version bump. Remove old cruft. Per bug #251766.
11 (Portage version: 2.2_rc23/cvs/Linux x86_64)
12
13 Revision Changes Path
14 1.7 sci-misc/boinc/files/boinc.init
15
16 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-misc/boinc/files/boinc.init?rev=1.7&view=markup
17 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-misc/boinc/files/boinc.init?rev=1.7&content-type=text/plain
18 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-misc/boinc/files/boinc.init?r1=1.6&r2=1.7
19
20 Index: boinc.init
21 ===================================================================
22 RCS file: /var/cvsroot/gentoo-x86/sci-misc/boinc/files/boinc.init,v
23 retrieving revision 1.6
24 retrieving revision 1.7
25 diff -u -r1.6 -r1.7
26 --- boinc.init 18 Dec 2005 13:29:00 -0000 1.6
27 +++ boinc.init 31 Jan 2009 15:19:36 -0000 1.7
28 @@ -3,49 +3,85 @@
29 opts="${opts} attach"
30
31 depend() {
32 - use dns
33 - need net
34 + # we can use dns and net, but we can also in most cases live without them
35 + use dns net
36 }
37
38 -start() {
39 - ebegin "Starting BOINC"
40 - if [ ! -d ${RUNTIMEDIR} ]; then
41 - einfo "Directory ${RUNTIMEDIR} not existing, creating now."
42 - /bin/mkdir ${RUNTIMEDIR}
43 - /bin/chown ${USER}:${GROUP} ${RUNTIMEDIR}
44 - if [ ! -d ${RUNTIMEDIR} ]; then
45 - eerror "Directory ${RUNTIMEDIR} could not be created!"
46 +create_work_directory() {
47 + if [[ ! -d $RUNTIMEDIR ]]; then
48 + einfo "Directory $RUNTIMEDIR not existing, creating now."
49 + mkdir $RUNTIMEDIR
50 + chown ${USER}:${GROUP} $RUNTIMEDIR
51 + if [[ ! -d $RUNTIMEDIR ]]; then
52 + eeror "Directory $RUNTIMEDIR could not be created!"
53 return 1
54 fi
55 + ln -s /etc/ssl/certs/ca-certificates.crt $RUNTIMEDIR/ca-bundle.crt
56 fi
57 +}
58
59 - cd ${RUNTIMEDIR}
60 +generate_logs() {
61 + if [[ ! -f $LOGFILE ]]; then
62 + einfo "No $LOGFILE around. Creating new..."
63 + einfo "For good log rotation is great tool app-admin/logrotate"
64 + touch $LOGFILE
65 + chown ${USER}:${GROUP} $LOGFILE
66 + fi
67 +}
68
69 - if [ ! -f lockfile ]; then
70 - einfo "File ${RUNTIMEDIR}/lockfile does not exist, assuming first run."
71 - einfo "You need to setup an account on the BOINC project homepage beforehand! Go to http://boinc.berkeley.edu/ and locate your project."
72 - einfo "Then either run /etc/init.d/boinc attach or connect with a gui client and attach to a project with that."
73 +cuda_check() {
74 + if [[ -f /opt/cuda/lib/libcudart.so ]]; then
75 + # symlink wont harm :]
76 + ln -snf /opt/cuda/lib/libcudart.so $RUNTIMEDIR/libcudart.so
77 fi
78 +}
79
80 - # if the log file doesn't exist, create it with root privs, then change ownership to boinc
81 - if [ ! -f ${LOGFILE} ]; then
82 - touch ${LOGFILE}
83 - chown ${USER}:${GROUP} ${LOGFILE}
84 - else
85 - mv ${LOGFILE} ${LOGFILE}.old
86 - touch ${LOGFILE}
87 - chown ${USER}:${GROUP} ${LOGFILE}
88 +start() {
89 + ebegin "Starting BOINC"
90 +
91 + create_work_directory
92 + cuda_check
93 +
94 + cd $RUNTIMEDIR
95 +
96 + if [[ ! -f lockfile ]]; then
97 + einfo "File $RUNTIMEDIR/lockfile does not exist, assuming first run."
98 + einfo "You need to setup an account on the BOINC project homepage beforehand!"
99 + einfo "Go to http://boinc.berkeley.edu/ and locate your project."
100 + einfo "Then either run /etc/init.d/boinc attach or connect with a gui client"
101 + einfo "and attach to a project with that."
102 + echo
103 + ewarn "Note that for attaching to some project you need your network up and running."
104 + ewarn "network is needed only for jobs fetching afterwards"
105 fi
106
107 - if [ ${ALLOW_REMOTE_RPC} = "yes" ]; then
108 + generate_logs
109 +
110 + if [[ ${ALLOW_REMOTE_RPC} = "yes" ]]; then
111 ARGS="${ARGS} -allow_remote_gui_rpc"
112 fi
113 +
114 + # sys-apps/util-linux
115 + CHRT="/usr/bin/chrt ${SCHED_PARAM}"
116
117 - setsid start-stop-daemon --quiet --start --chdir ${RUNTIMEDIR} \
118 + ${CHRT} start-stop-daemon \
119 + --quiet --start --chdir ${RUNTIMEDIR} \
120 --exec ${BOINCBIN} --chuid ${USER}:${GROUP} \
121 - --nicelevel ${NICELEVEL} -- ${ARGS} > ${LOGFILE} 2>&1 &
122 + --background --stdout ${LOGFILE} --stderr ${LOGFILE} \
123 + --nicelevel ${NICELEVEL} -- ${ARGS}
124
125 - eend $?
126 + RESULT=$?
127 +
128 + if [ "${CPU_SHARE}" -a -d /sys/kernel/uids ]; then
129 + BUID=`id -u ${USER}`
130 + # It might take a moment for start-stop-daemon to chuid
131 + [[ -d /sys/kernel/uids/${BUID} ]] || sleep 5 # 5 was working always here
132 + if [[ -w /sys/kernel/uids/${BUID}/cpu_share ]]; then
133 + echo ${CPU_SHARE} > /sys/kernel/uids/${BUID}/cpu_share
134 + fi
135 + fi
136 +
137 + eend $RESULT
138 }
139
140 attach() {
141 @@ -55,26 +91,27 @@
142 read key
143
144 RC_QUIET_STDOUT="yes" svc_status
145 - if [ $? == 1 ]; then
146 + if [[ $? = 1 ]]; then
147 svc_start
148 fi
149 ebegin "Attaching to project"
150 - # boinc cmd does not return 1 when it fails currently
151 - boinc_cmd --project_attach ${url} ${key} &> /dev/null
152 + # we have to work in runtime directory
153 + cd $RUNTIMEDIR
154 + # boinc does not return 1 when it fails currently
155 + $BOINCBIN --attach_project $url $key &> /dev/null
156 eend $?
157
158 sleep 10
159 - tail ${LOGFILE}
160 + tail $LOGFILE
161 }
162
163 stop() {
164 ebegin "Stopping BOINC"
165 - start-stop-daemon --stop --quiet --exec ${BOINCBIN}
166 + start-stop-daemon --stop --retry 3 --quiet --exec $BOINCBIN
167 eend $?
168 }
169
170 restart() {
171 svc_stop
172 - sleep 6
173 svc_start
174 }
175
176
177
178 1.3 sci-misc/boinc/files/boinc.conf
179
180 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-misc/boinc/files/boinc.conf?rev=1.3&view=markup
181 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-misc/boinc/files/boinc.conf?rev=1.3&content-type=text/plain
182 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-misc/boinc/files/boinc.conf?r1=1.2&r2=1.3
183
184 Index: boinc.conf
185 ===================================================================
186 RCS file: /var/cvsroot/gentoo-x86/sci-misc/boinc/files/boinc.conf,v
187 retrieving revision 1.2
188 retrieving revision 1.3
189 diff -u -r1.2 -r1.3
190 --- boinc.conf 29 Oct 2005 14:49:52 -0000 1.2
191 +++ boinc.conf 31 Jan 2009 15:19:36 -0000 1.3
192 @@ -18,3 +18,11 @@
193
194 # nice level
195 NICELEVEL="19"
196 +
197 +# scheduling parameters, arguments to chrt(1)
198 +SCHED_PARAM="--batch 0"
199 +
200 +# Relative CPU allocation for boinc user, default is 1024,
201 +# requires CONFIG_FAIR_GROUP_SCHED and CONFIG_USER_SCHED,
202 +# see /usr/src/linux/Documentation/scheduler/sched-design-CFS.txt
203 +CPU_SHARE="128"