Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 9467 - setiathome rc script enhancement
Summary: setiathome rc script enhancement
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: Lowest enhancement (vote)
Assignee: Daniel Ahlberg (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on: 8600
Blocks:
  Show dependency tree
 
Reported: 2002-10-21 21:28 UTC by Max Kalika (RETIRED)
Modified: 2003-05-04 09:36 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
reworked setiathome rc script to allow configurable number of threads (setiathome,1.56 KB, text/plain)
2003-02-05 16:09 UTC, Max Kalika (RETIRED)
Details
patch for the current setiathome init script (seti-init.d-r1.alt-dir_and_conf-threads.patch,2.78 KB, patch)
2003-04-17 21:06 UTC, Max Kalika (RETIRED)
Details | Diff
patch for the current setiathome init script conf file (seti-conf.d-r1.alt-dir_and_conf-threads.patch,596 bytes, patch)
2003-04-17 21:07 UTC, Max Kalika (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Max Kalika (RETIRED) gentoo-dev 2002-10-21 21:28:22 UTC
I didn't like the idea of seti writing files to /opt.  Here's a simple patch 
that uses the SETIATHOME_DIR conf.d variable slightly differently.  This also 
adds a necessary "need net" depend.  I would also change the default 
conf.d/setiathome file to set SETIATHOME_DIR to /var/lib/setiathome (seems most 
reasonable).

----------------------------------
--- setiathome.orig     2002-10-21 19:06:52.000000000 -0700
+++ setiathome  2002-10-21 19:11:22.000000000 -0700
@@ -1,17 +1,21 @@
 #!/sbin/runscript

+depend() {
+       need net
+}
+
 checkconfig() {
        if [ ! -e ${SETIATHOME_DIR} ]
        then
                einfo "Creating ${SETIATHOME_DIR}"
-               mkdir ${SETIATHOME_DIR}
+               mkdir -p ${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
+               /opt/setiathome/setiathome -login
        fi
 }

@@ -20,7 +24,7 @@

        ebegin "Starting SETI@home"
        cd ${SETIATHOME_DIR}
-       ./setiathome ${SETIATHOME_OPTIONS} >&/dev/null&
+       /opt/setiathome/setiathome ${SETIATHOME_OPTIONS} >&/dev/null&
        eend $?
 }
----------------------------------
Comment 1 SpanKY gentoo-dev 2002-10-21 22:08:17 UTC
hmm, i like the idea of using /var/lib/setiathome/ ...

i was in the process of rewriting the seti@home stuff anyways ...
Comment 2 Max Kalika (RETIRED) gentoo-dev 2003-02-05 16:09:07 UTC
Created attachment 7963 [details]
reworked setiathome rc script to allow configurable number of threads

This is a whole new rc script reworked to allow a configurable number of
threads.  It builds upon the cpu-detection magic.  The reason for this is that
on clusters, the number of processors is still far lower than what one might
want to run.  This new rc script basically adds a SETIATHOME_THREADS variable
in /etc/conf.d/setiathome.  It also fixes the path of the setiathome binary to
not expect local directory.  So a new default /etc/conf.d/setiathome file would
look like this:

# Config file for /etc/init.d/setiathome

# specify the number of setiathome processes to start
SETIATHOME_THREADS="10"

# set up any options you want for setiathome here
# for more info, `setiathome -h`
SETIATHOME_OPTIONS="-nice 19"

# this is the directory where setiathome's data files will be stored
SETIATHOME_DIR=/var/lib/setiathome
Comment 3 Max Kalika (RETIRED) gentoo-dev 2003-02-05 18:03:58 UTC
oops!  sorry, the default SETIATHOME_THREADS should be 1 or commented out -- not 
10 :-) 
Comment 4 Martin Holzer (RETIRED) gentoo-dev 2003-03-12 17:59:48 UTC
zetagrid and dnetc are also in /opt
please leave it there
Comment 5 Max Kalika (RETIRED) gentoo-dev 2003-03-12 18:15:57 UTC
The point of this is not to move seti out of /opt -- just the run-time files 
seti generates while it's processing.  It is just not good form to write 
to a directory like /opt or /usr while running (many sysadmins strive to 
keep those directories as though they were mounted on read-only media). 
 
In fact the rc script assumes the setiathome binary is still installed as 
/opt/setiathome/setiathome -- just the location of all the *.sah files has been 
moved to /var/lib/setiathome. 
Comment 6 Seth Chandler 2003-04-17 18:33:00 UTC
sorry, we're leaving it in opt, i know it suckors, but its the way we do it with zetagrid and others...

fixed the need net
Comment 7 Max Kalika (RETIRED) gentoo-dev 2003-04-17 19:54:17 UTC
I'm sorry?  Did someone not read my previous comment?  I am not proposing to move 
seti out of /opt.  I have no problems having it in /opt.  I just think its poor form (and 
IIRC a violation of FHS) to have the changeable data files in a directory that can 
potentially be mounted read-only!  Therefore what I have posted was a very 
straightforward fix to just change the location of the *.sah files. 
 
Please reconsider. 
Comment 8 Seth Chandler 2003-04-17 20:19:44 UTC
post a fix against the rc-script i just commited and i'll apply it =) 
Comment 9 Max Kalika (RETIRED) gentoo-dev 2003-04-17 21:06:35 UTC
Created attachment 10815 [details, diff]
patch for the current setiathome init script

ahoy! here it be matey!

this allows for the data files to be in any configurable place (the
to-be-posted-next conf file patch puts them in /var/lib/setiathome by default).
 it also allows a configurable number of threads (for those of us with clusters
can specify this to be higher than the number of physical processes.  the
aforementioned-upcoming-conf file patch defaults this to 1).
Comment 10 Max Kalika (RETIRED) gentoo-dev 2003-04-17 21:07:13 UTC
Created attachment 10816 [details, diff]
patch for the current setiathome init script conf file

and the promised conf-file patch.
Comment 11 Max Kalika (RETIRED) gentoo-dev 2003-04-23 08:47:36 UTC
any chance of getting this re-opened so it doesn't fall through the cracks?
Comment 12 Seth Chandler 2003-04-23 14:31:54 UTC
asdfasdf 
 
Comment 13 Seth Chandler 2003-04-23 15:55:23 UTC
so whats the deal, should i aply both of these patches? 
Comment 14 Max Kalika (RETIRED) gentoo-dev 2003-04-23 16:01:58 UTC
yes, if you deem appropriate.  one patch is for the rc script itself and the second is for 
the /etc/conf.d/setiathome file. 
Comment 15 Daniel Ahlberg (RETIRED) gentoo-dev 2003-05-04 09:36:48 UTC
Commited to 3.08-r1.