diff options
author | Brandon Low <lostlogic@gentoo.org> | 2005-02-04 20:57:01 +0000 |
---|---|---|
committer | Brandon Low <lostlogic@gentoo.org> | 2005-02-04 20:57:01 +0000 |
commit | d16b0cde2c8ec24e6f412469cabee28b17f7bd02 (patch) | |
tree | 5d33b29235eabdeb877d6dd34a1aadf399ea8fb9 /sci-biology/foldingathome/files | |
parent | Stable on alpha. (diff) | |
download | gentoo-2-d16b0cde2c8ec24e6f412469cabee28b17f7bd02.tar.gz gentoo-2-d16b0cde2c8ec24e6f412469cabee28b17f7bd02.tar.bz2 gentoo-2-d16b0cde2c8ec24e6f412469cabee28b17f7bd02.zip |
Fix bug #79574. Add unitinfo target to initscript to get the status of each core on the system. Thanks to Yosef Meller <yosefm@gmail.com> for the idea and initial patch
(Portage version: 2.0.51-r15)
Diffstat (limited to 'sci-biology/foldingathome/files')
-rw-r--r-- | sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r2 | 1 | ||||
-rw-r--r-- | sci-biology/foldingathome/files/init-5.0.2-r2 | 55 |
2 files changed, 56 insertions, 0 deletions
diff --git a/sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r2 b/sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r2 new file mode 100644 index 000000000000..44de62a3f7fd --- /dev/null +++ b/sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r2 @@ -0,0 +1 @@ +MD5 4855e808fb94e6d2c5fde345aea0cdc3 FAH502-Linux.exe 249236 diff --git a/sci-biology/foldingathome/files/init-5.0.2-r2 b/sci-biology/foldingathome/files/init-5.0.2-r2 new file mode 100644 index 000000000000..a3bcf284448e --- /dev/null +++ b/sci-biology/foldingathome/files/init-5.0.2-r2 @@ -0,0 +1,55 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-biology/foldingathome/files/init-5.0.2-r2,v 1.1 2005/02/04 20:57:01 lostlogic Exp $ + +opts="${opts} unitinfo" + +unitinfo() { + do_config + for (($CPU; CPU > 0; CPU--)); do + einfo "CPU ${CPU} $(head -n1 /opt/foldingathome/client${CPU}/unitinfo.txt):" + sed -e '1,2d' /opt/foldingathome/client${CPU}/unitinfo.txt + done +} + +do_config() { + if [ -z "${CPU}" ] || [ "${CPU}" == "0" ]; then + if [ -r /proc/cpuinfo ]; then + CPU=`grep processor </proc/cpuinfo | wc -l` + else + CPU=1 + fi + fi +} + +start() { + do_config + su foldingathome -c /opt/foldingathome/copy_client_config + for (($CPU; CPU > 0; CPU--)); do + ebegin "Starting Folding@Home on CPU ${CPU}" + cd /opt/foldingathome/client${CPU}/ + nice -n 20 su foldingathome -c "/opt/foldingathome/client${CPU}/foldingathome ${FOLD_OPTS}" &>/dev/null & + eend $? + done +} + +stop() { + do_config + for (($CPU; CPU > 0; CPU--)); do + ebegin "Stopping Folding@Home on CPU ${CPU}" + cd /opt/foldingathome/client${CPU}/ + for I in FahCore*.exe; do + if ps ax|grep $I > /dev/null 2>&1; then + killall -q $I > /dev/null 2>&1 + fi + done + sleep 1 + if ps ax|grep '[/]opt[/]foldingathome/client${CPU}/' > /dev/null 2>&1; then + eend 1 + else + eend 0 + fi + done +} + |