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
Date: Thu, 23 Apr 2009 16:13:41
Message-Id: E1Lx1YL-0007kM-Uc@stork.gentoo.org
1 scarabeus 09/04/23 16:13:33
2
3 Modified: boinc.init
4 Log:
5 Some gentoo syntax improvement in init.d file.
6 (Portage version: 2.2_rc30/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.13 sci-misc/boinc/files/boinc.init
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-misc/boinc/files/boinc.init?rev=1.13&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-misc/boinc/files/boinc.init?rev=1.13&content-type=text/plain
13 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-misc/boinc/files/boinc.init?r1=1.12&r2=1.13
14
15 Index: boinc.init
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo-x86/sci-misc/boinc/files/boinc.init,v
18 retrieving revision 1.12
19 retrieving revision 1.13
20 diff -u -r1.12 -r1.13
21 --- boinc.init 23 Apr 2009 16:00:17 -0000 1.12
22 +++ boinc.init 23 Apr 2009 16:13:33 -0000 1.13
23 @@ -8,31 +8,31 @@
24 }
25
26 create_work_directory() {
27 - if [[ ! -d $RUNTIMEDIR ]]; then
28 - einfo "Directory $RUNTIMEDIR not existing, creating now."
29 - mkdir $RUNTIMEDIR
30 - chown ${USER}:${GROUP} $RUNTIMEDIR
31 - if [[ ! -d $RUNTIMEDIR ]]; then
32 - eeror "Directory $RUNTIMEDIR could not be created!"
33 + if [[ ! -d ${RUNTIMEDIR} ]]; then
34 + einfo "Directory ${RUNTIMEDIR} not existing, creating now."
35 + mkdir ${RUNTIMEDIR}
36 + chown ${USER}:${GROUP} ${RUNTIMEDIR}
37 + if [[ ! -d ${RUNTIMEDIR} ]]; then
38 + eeror "Directory ${RUNTIMEDIR} could not be created!"
39 return 1
40 fi
41 - ln -s /etc/ssl/certs/ca-certificates.crt $RUNTIMEDIR/ca-bundle.crt
42 + ln -s /etc/ssl/certs/ca-certificates.crt ${RUNTIMEDIR}/ca-bundle.crt
43 fi
44 }
45
46 generate_logs() {
47 - if [[ ! -f $LOGFILE ]]; then
48 - einfo "No $LOGFILE around. Creating new..."
49 + if [[ ! -f ${LOGFILE} ]]; then
50 + einfo "No ${LOGFILE} around. Creating new..."
51 einfo "For good log rotation is great tool app-admin/logrotate"
52 - touch $LOGFILE
53 - chown ${USER}:${GROUP} $LOGFILE
54 + touch ${LOGFILE}
55 + chown ${USER}:${GROUP} ${LOGFILE}
56 fi
57 }
58
59 cuda_check() {
60 if [[ -f /opt/cuda/%LIBDIR%/libcudart.so ]]; then
61 # symlink wont harm :]
62 - ln -snf /opt/cuda/%LIBDIR%/libcudart.so $RUNTIMEDIR/libcudart.so
63 + ln -snf /opt/cuda/%LIBDIR%/libcudart.so ${RUNTIMEDIR}/libcudart.so
64 fi
65 }
66
67 @@ -42,7 +42,7 @@
68 create_work_directory
69 cuda_check
70
71 - cd $RUNTIMEDIR
72 + pushd ${RUNTIMEDIR} > /dev/null
73
74 if [[ ! -f lockfile ]]; then
75 einfo "File $RUNTIMEDIR/lockfile does not exist, assuming first run."
76 @@ -88,7 +88,7 @@
77 fi
78 fi
79
80 - eend $RESULT
81 + eend ${RESULT}
82 }
83
84 attach() {
85 @@ -103,18 +103,19 @@
86 fi
87 ebegin "Attaching to project"
88 # we have to work in runtime directory
89 - cd $RUNTIMEDIR
90 + pushd ${RUNTIMEDIR} > /dev/null
91 # boinc does not return 1 when it fails currently
92 - $BOINCBIN --chuid ${USER}:${GROUP} --attach_project $url $key &> /dev/null
93 + ${BOINCBIN} --chuid ${USER}:${GROUP} --attach_project ${url} ${key} &> /dev/null
94 + popd > /dev/null
95 eend $?
96
97 sleep 10
98 - tail $LOGFILE
99 + tail ${LOGFILE}
100 }
101
102 stop() {
103 ebegin "Stopping BOINC"
104 - start-stop-daemon --stop --retry 3 --quiet --exec $BOINCBIN
105 + start-stop-daemon --stop --retry 3 --quiet --exec ${BOINCBIN}
106 eend $?
107 }