summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2009-11-22 13:38:27 +0000
committerTomas Chvatal <scarabeus@gentoo.org>2009-11-22 13:38:27 +0000
commit4fd2c2f2524c529a5a87dbdd2528f0889ef725c5 (patch)
tree40403d7dc7ee9aebc213a152d2d960276f5ef975 /sci-misc
parentStable on alpha, bug #289857 (diff)
downloadgentoo-2-4fd2c2f2524c529a5a87dbdd2528f0889ef725c5.tar.gz
gentoo-2-4fd2c2f2524c529a5a87dbdd2528f0889ef725c5.tar.bz2
gentoo-2-4fd2c2f2524c529a5a87dbdd2528f0889ef725c5.zip
Update script attach function to work correcty.
(Portage version: 2.2_rc51/cvs/Linux x86_64)
Diffstat (limited to 'sci-misc')
-rw-r--r--sci-misc/boinc/ChangeLog5
-rw-r--r--sci-misc/boinc/files/boinc.init35
2 files changed, 24 insertions, 16 deletions
diff --git a/sci-misc/boinc/ChangeLog b/sci-misc/boinc/ChangeLog
index 759ac1f66dd3..55aa4c38f60b 100644
--- a/sci-misc/boinc/ChangeLog
+++ b/sci-misc/boinc/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for sci-misc/boinc
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-misc/boinc/ChangeLog,v 1.81 2009/11/14 01:40:46 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-misc/boinc/ChangeLog,v 1.82 2009/11/22 13:38:26 scarabeus Exp $
+
+ 22 Nov 2009; Tomáš Chvátal <scarabeus@gentoo.org> files/boinc.init:
+ Update script attach function to work correcty.
14 Nov 2009; Tomáš Chvátal <scarabeus@gentoo.org> boinc-6.10.18.ebuild:
Drop the server support from now on. Better for my sanity sorry guys.
diff --git a/sci-misc/boinc/files/boinc.init b/sci-misc/boinc/files/boinc.init
index dcc9b8b2f15d..b8a920b5018c 100644
--- a/sci-misc/boinc/files/boinc.init
+++ b/sci-misc/boinc/files/boinc.init
@@ -56,22 +56,21 @@ start() {
ewarn "network is needed only for jobs fetching afterwards"
fi
- generate_logs
-
if [ "${ALLOW_REMOTE_RPC}" = "yes" ]; then
ARGS="${ARGS} -allow_remote_gui_rpc"
fi
- # sys-apps/util-linux
- CHRT="/usr/bin/chrt ${SCHED_PARAM}"
-
- # check for baselayout version
if [ -n "${RC_UNAME}" ]; then
PARAMS="--background --stdout '${LOGFILE}' --stderr '${LOGFILE}' -- ${ARGS}"
else
PARAMS="-- ${ARGS} >> '${LOGFILE}' 2>&1 &"
fi
+ generate_logs
+
+ # sys-apps/util-linux
+ CHRT="/usr/bin/chrt ${SCHED_PARAM}"
+
eval ${CHRT} start-stop-daemon \
--quiet --start --chdir "${RUNTIMEDIR}" \
--pidfile "${PIDFILE}" \
@@ -95,26 +94,32 @@ start() {
}
attach() {
+ local password args url key
+ local was_started=true
+
printf " Enter the Project URL: "
read url
printf " Enter your Account Key: "
read key
- RC_QUIET_STDOUT="yes" status
- if [ $? = 1 ]; then
- start
+ password=$(cat "${RUNTIMEDIR}/gui_rpc_auth.cfg")
+ args="--project_attach ${url} ${key}"
+
+ if ! service_started; then
+ was_started=false
+ "${RC_SERVICE}" start
fi
+
ebegin "Attaching to project"
- # we have to work in runtime directory
- cd "${RUNTIMEDIR}"
- # boinc does not return 1 when it fails currently
- "${BOINCBIN}" --attach_project "${url}" "${key}" &> /dev/null
- # change the perms for the files to defined user/group
- chown -R ${USER}:${GROUP} *
+ boinccmd --host localhost --passwd ${password} ${args}
eend $?
+ unset password args url key
+
sleep 10
tail "${LOGFILE}"
+
+ [[ ${was_started} = "false" ]] && "${RC_SERVICE}" stop
}
stop() {