From 649d8f8c9430bc0485cbc6dda54a16bf3b8c4edd Mon Sep 17 00:00:00 2001 From: Stefan Bethke Date: Tue, 18 May 1999 22:40:35 +0000 Subject: - Added support for SMP systems to etc/rc.d/setiathome.sh - Added etc/setiathome.conf with options to set the nice level, the max. number of processes to run, the working directory, and the the user id to run as. - setiathome.1 was missing from Makefile (and +CONTENTS subsequently) - Updated the man page to reflect the changes. --- astro/setiathome/files/setiathome.1 | 177 +++++++++++++++++++++++++---------- astro/setiathome/files/setiathome.sh | 92 ++++++++++++++++++ 2 files changed, 222 insertions(+), 47 deletions(-) create mode 100644 astro/setiathome/files/setiathome.sh (limited to 'astro/setiathome/files') diff --git a/astro/setiathome/files/setiathome.1 b/astro/setiathome/files/setiathome.1 index ccf317d51f0b..8ec8f76d1e44 100644 --- a/astro/setiathome/files/setiathome.1 +++ b/astro/setiathome/files/setiathome.1 @@ -1,5 +1,6 @@ .\" Copyright status unkown -.Dd April 19, 1999 +.\" $Id$ +.Dd May 19, 1999 .Dt setiathome 1 LOCAL .Os FreeBSD .Sh NAME @@ -10,7 +11,9 @@ .Op Ar options .Sh DESCRIPTION .Nm -is the UNIX version of the +is the +.Ux +version of the .Tn SETI@home client. It downloads radio telescope data from a network server, analyzes the data looking for signals of extraterrestrial origin, and uploads results @@ -33,32 +36,72 @@ if you like. can be freely aborted and restarted. It saves its state in files, and will pick up where it left off. .Pp +If you want to run multiple instances of setiathome +(on a multiprocessor machine, or on multiple machines +that share a filesystem) each one must be run +in a different directory. +.Pp +.Nm +requires about 0.5\ MBytes of disk space per working directory, and about +12\ MBytes of memory per instance. If you have ample physical memory, it's work load +should be almost undetectable. Additionally, .Nm -requires about 0.5\ MBytes of disk space in it's working directory, and about -12\ MBytes of memory. If you have ample physical memory, it's work load -should be almost undetectable. +requires a permanent or +.Dq dial on demand +Internet connection to upload results to and download new work units from the +.Tn SETI@home +server at any time. .Ss Starting setiathome -This port to FreeBSD includes a start-up script (usually found in -.Pa /usr/local/etc/rc.d/setiathome.sh ) -that starts +This +.Fx +port includes a start-up script that starts +.Nm +at system start-up. +.Ss Configuration File +The optional configuration file +.Pa /usr/local/etc/setiathome.conf +can contain one or more of the following variable assignments to override +their default values: +.Bl -tag -width seti_wrkdir +.It Pa seti_wrkdir=/var/db/setiathome +The working directory where .Nm -at system start-up. You can also use this script to set up a working -directory -.Pa ( /var/db/setiathome ) , +will store it's temporary files. +.It Pa seti_user=nobody +The user to run +.Nm +as. +.It Pa seti_nice=1 +The +.Xr nice 1 +value to run +.Nm +as. +.It Pa seti_maxprocs= Ns Va Number of CPUs +The number of +.Nm +processes to run concurrently. Defaults to the number of CPUs installed. +Running more than one instance per CPU is not useful, as +.Nm +is almost completely CPU-bound. +.El +.Pp +If you change values in the configuration file, you need to stop and start +.Nm Ns , +and possibly reconfigure the working directory for the changes to take +effect. Run +.Dl /usr/local/etc/rc.d/setiathome.sh stop +.Dl /usr/local/etc/rc.d/setiathome.sh register +.Dl /usr/local/etc/rc.d/setiathome.sh start +to do that. +.Ss Setting up setiathome +You can use the start-up script to set up a working directory and register with or log in to .Tn SETI@home by calling it with the argument .Ar register . -.Ss Setting up setiathome manually -If you'd like to run -.Nm -on a SMP system, and therefor would like to run multiple -.Nm -processes at once, or would like it to run under a different user ID than -.Sq nobody , -you have to set up one or more suitable working directories yourself. -.Pp -For each +If you'd like to configure and run it manually, you should first disable the +start-up script. Then, for each .Nm instance you'd like to run, create a directory, make it owned by the user you'd like to run @@ -78,24 +121,31 @@ to .Ed to the user's crontab. .Sh OPTIONS -.Bl -tag -width indent -.It Fl login -Login or create new account. +.Bl -tag -width countries .It Fl countries -Show list of country codes. -.It Fl version -Show software version -.It Fl nice Ar N -Set "nice" priority to -.Ar N -(default 1); +Show list of country codes (a numeric country code must be entered during +registration). .It Fl email -Send email (to login email address) on errors. Useful if you run in -background directed to +Send email (to the email address registered with +.Tn SETI@home ) +on errors. Useful if you run +.Nm +in the background with the output directed to .Pa /dev/null . -.It Fl proxy Ar host:port +.It Fl login +Log in to or register with +.Tn SETI@home . +.It Fl nice Ar N +Set +.Xr nice 1 +priority to +.Ar N +(default 1). +.It Fl proxy Va hostname Ns Xo +.Op Li : Ns Va port +.Xc Use the HTTP proxy server -.Ar host +.Ar hostname at port .Ar port to download work units and upload results. Alternatively, you can set the @@ -105,25 +155,58 @@ environment variable Process the current work unit and exit before uploading the result. .It Fl stop_after_xfer Process the current work unit and upload the result, then exit. +.It Fl version +Show software version. +.El +.Sh ENVIRONMENT +.Bl -tag -width HTTP_PROXY +.It Ev HTTP_PROXY +The address (in the form +.Do Va hostname Ns +.Op Li : Ns Va port +.Dc ) +of a HTTP proxy server to download work units and upload results via. .El -.Pp .Sh FILES -The program generates several files with -.Pa .txt -extension in the directory from which it's run. These should not be -modified. .Pp -If you want to run multiple instances of setiathome -(on a multiprocessor machine, or on multiple machines -that share a filesystem) each one must be run -in a different directory. +.Bl -tag -width /var/db -compact +.It Pa /var/db/setiathome/ +Primary working directory. +.It Pa /var/db/setiathome/user_info.txt +Registration data. +.It Pa /var/db/setiathome/ Ns Va n Ns / +Working directories for additional process +.Va n +(when running more than one instance). +.It Pa /var/db/setiathome/ Ns Xo +.Op Ns Va n Ns Li / Ns +.Pa lock.txt +.Xc +Lock file to prevent multiple instances to work on the same data. +.It Pa /var/db/setiathome/ Ns Xo +.Op Ns Va n Ns Li / Ns +.Pa *.txt +.Xc +Working files. +.It Pa /usr/local/etc/rc.d/setiathome.sh +Startup script. +.Sh BUGS +As of version 1.1, the proxy setting ignores the +.Va port +argument in both the option and the environment variable. .Pp -setiathome uses a lock file -.Pa ( lock.txt ) -to prevent multiple instances from running in the same directory. +There is currently no easy way to run +.Nm +continuosly if you don't have a permanent or +.Dq dial on demand +Internet connection. .Sh AUTHORS .Tn SETI@home was developed by David Anderson, Jeff Cobb, Charles Congdon, Charlie Fenton, David Gedye, Kyle Granger, Eric Korpela, Matt Lebofsky, Peter Leiser, Brad Silen, Woody Sullivan, and Dan Werthimer. .Pp +.An Stefan Bethke +amended the original manual page for this +.Fx +port. diff --git a/astro/setiathome/files/setiathome.sh b/astro/setiathome/files/setiathome.sh new file mode 100644 index 000000000000..939cc9ad3310 --- /dev/null +++ b/astro/setiathome/files/setiathome.sh @@ -0,0 +1,92 @@ +#!/bin/sh + +# +# Start or stop setiathome, or set up working directory and register +# + +# override these variables in ${PREFIX}/etc/setiathome.conf +seti_wrkdir=/var/db/setiathome # primary working directory +seti_user=nobody # user id to run as +seti_nice=1 # nice level to run at +seti_maxprocs=`sysctl -n hw.ncpu` # max. number of processes to start + +PREFIX=/`expr $0 : '/\(.*\)/etc/rc.d/setiathome.sh'` +if [ "x${PREFIX}" = "x/" ]; then + printf "\n`basename $0`: Cannot determine PREFIX.\nPlease use the complete pathname." >&2 + exit 64 +fi + +if [ -f ${PREFIX}/etc/setiathome.conf ]; then + . ${PREFIX}/etc/setiathome.conf +fi + +i=${seti_maxprocs} +seti_wrksuff="." +while [ ${i} -gt 1 ]; do + seti_wrksuff="${seti_wrksuff} ${i}" + i=`expr ${i} - 1` +done + +case $1 in + start) + for i in ${seti_wrksuff}; do + if [ ! -d ${seti_wrkdir}/${i} ]; then + logger -sp daemon.err -t setiathome \ + "unable to start: ${seti_wrkdir}/${i} is missing." + exit 72 + fi + if [ ! -f ${seti_wrkdir}/${i}/user_info.txt ]; then + logger -sp daemon.err -t setiathome \ + "unable to start: please log in to SETI@home first. (${seti_wrkdir}/${i}/user_info.txt is missing.)" + exit 72 + fi + done + for i in ${seti_wrksuff}; do + su -m ${seti_user} -c \ + "(cd ${seti_wrkdir}/${i} && exec ${PREFIX}/bin/setiathome -email -nice ${seti_nice} >/dev/null &)" + echo -n " SETI@home" + done + ;; + + stop) + killall setiathome + ;; + + register) + # Create or update primary working directory (in case the uid changed) + mkdir -p ${seti_wrkdir} + chown ${seti_user} ${seti_wrkdir} + chmod u=Xrw,g=Xr,o=Xr ${seti_wrkdir} + if [ -f ${seti_wrkdir}/user_info.txt ]; then + echo " It seems you have already registered with SETI@home. Would you like" + echo -n " to repeat the procedure? [Y/n] " + read a + if [ "X${a}" = "Xn" -o "X${a}" = "XN" ]; then + seti_dontlogin=yes + fi + fi + # No need to register if we've already done so + if [ "X${seti_dontlogin}" != "Xyes" ]; then + su -m ${seti_user} -c "cd ${seti_wrkdir} && ${PREFIX}/bin/setiathome -login" + fi + + if [ ${seti_maxprocs} -gt 1 ]; then + echo " Updating additional working directories." + i=${seti_maxprocs} + while [ ${i} -gt 1 ]; do + mkdir -p ${seti_wrkdir}/${i} + chown ${seti_user} ${seti_wrkdir}/${i} + chmod 755 ${seti_wrkdir}/${i} + # Assume the user want's all processes to run with the same registration + rm -f ${seti_wrkdir}/${i}/user_info.txt + ln -sf ../user_info.txt ${seti_wrkdir}/${i} + i=`expr ${i} - 1` + done + fi + ;; + + *) + echo "usage: `basename $0` {start|stop|register}" >&2 + exit 64 + ;; +esac -- cgit v1.2.3