summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Ahlberg <aliz@gentoo.org>2002-11-04 12:52:54 +0000
committerDaniel Ahlberg <aliz@gentoo.org>2002-11-04 12:52:54 +0000
commitdba42e134902210eec27ba40f06b940089a8e176 (patch)
tree2dfb62cbb38f2328961916ce1826efd8f5981982 /app-sci/setiathome
parentVersion bump and rename (diff)
downloadgentoo-2-dba42e134902210eec27ba40f06b940089a8e176.tar.gz
gentoo-2-dba42e134902210eec27ba40f06b940089a8e176.tar.bz2
gentoo-2-dba42e134902210eec27ba40f06b940089a8e176.zip
Closes #7483.
Diffstat (limited to 'app-sci/setiathome')
-rw-r--r--app-sci/setiathome/ChangeLog6
-rw-r--r--app-sci/setiathome/files/seti-init.d-r167
2 files changed, 52 insertions, 21 deletions
diff --git a/app-sci/setiathome/ChangeLog b/app-sci/setiathome/ChangeLog
index 588cd957f697..8f861c5c5511 100644
--- a/app-sci/setiathome/ChangeLog
+++ b/app-sci/setiathome/ChangeLog
@@ -1,9 +1,13 @@
# ChangeLog for app-sci/setiathome
# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
-# $Header: /var/cvsroot/gentoo-x86/app-sci/setiathome/ChangeLog,v 1.3 2002/09/19 20:22:36 owen Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-sci/setiathome/ChangeLog,v 1.4 2002/11/04 12:52:54 aliz Exp $
*setiathome-3.03 (19 Jul 2002)
+ 04 Nov 2002; Daniel Ahlberg <aliz@gentoo.orv> files/seti-init.d :
+ Updated init.d script to take advantage of SMP. Script contributed by
+ delta407 <delta407@lerfjhax.com> in #7483.
+
19 Sep 2002; Owen Stampflee <owen@gentoo.org> :
Added PPC to KEYWORDS.
diff --git a/app-sci/setiathome/files/seti-init.d-r1 b/app-sci/setiathome/files/seti-init.d-r1
index 8433e18bb2c0..e8f34956bfa6 100644
--- a/app-sci/setiathome/files/seti-init.d-r1
+++ b/app-sci/setiathome/files/seti-init.d-r1
@@ -1,31 +1,58 @@
#!/sbin/runscript
+cpus=`grep -c processor /proc/cpuinfo`
+
checkconfig() {
- if [ ! -e ${SETIATHOME_DIR} ]
- then
- einfo "Creating ${SETIATHOME_DIR}"
- mkdir ${SETIATHOME_DIR}
- fi
-
- if [ ! -e ${SETIATHOME_DIR}/user_info.sah ]
- then
- einfo "Setting up SETI@home for the first time"
- cd ${SETIATHOME_DIR}
- ./setiathome -login
- fi
+ if [ ! -e ${SETIATHOME_DIR} ]
+ then
+ einfo "Creating ${SETIATHOME_DIR}"
+ mkdir ${SETIATHOME_DIR}
+ fi
+
+ if [ ! -e ${SETIATHOME_DIR}/user_info.sah ]
+ then
+ einfo "Setting up SETI@home for the first time"
+ cd ${SETIATHOME_DIR}
+ ./setiathome -login
+ fi
+
+ if [ $cpus != '1' ]; then
+ cd ${SETIATHOME_DIR}
+ for cpu in `seq 2 $cpus`; do
+ if [ ! -e ${SETIATHOME_DIR}/cpu${cpu} ]; then
+ mkdir ${SETIATHOME_DIR}/cpu${cpu}
+ cp ${SETIATHOME_DIR}/* ${SETIATHOME_DIR}/cpu${cpu} > /dev/null
+ rm ${SETIATHOME_DIR}/cpu${cpu}/*.sah > /dev/null
+ cp ${SETIATHOME_DIR}/user_info.sah ${SETIATHOME_DIR}/cpu${cpu}
+ fi
+ done
+ fi
}
start() {
- checkconfig
+ checkconfig
+
+
+ if [ $cpus = '1' ]; then
+ ebegin "Starting SETI@home"
+ else
+ ebegin "Starting SETI@home ($cpus processors)"
+ fi
+
+ for cpu in `seq 1 $cpus`; do
+ cd ${SETIATHOME_DIR}
+ if [ $cpu != '1' ]; then
+ cd cpu${cpu}
+ fi
+
+ ./setiathome ${SETIATHOME_OPTIONS} >&/dev/null&
+ done
- ebegin "Starting SETI@home"
- cd ${SETIATHOME_DIR}
- ./setiathome ${SETIATHOME_OPTIONS} >&/dev/null&
- eend $?
+ eend $?
}
stop() {
- ebegin "Stopping SETI@home"
- killall setiathome
- eend $?
+ ebegin "Stopping SETI@home"
+ killall setiathome
+ eend $?
}