Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 40120 - setiathome didn't run after merging
Summary: setiathome didn't run after merging
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords: EBUILD
: 41737 43642 43846 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-01 13:11 UTC by Ivar Ylvisaker
Modified: 2005-08-21 08:33 UTC (History)
9 users (show)

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


Attachments
corrected init.d - script. (setiathome,1.23 KB, text/plain)
2004-02-21 08:26 UTC, Mr. P
Details
init.d script for using seti user & group, plus also fix for stopping bug (setiathome,1.53 KB, text/plain)
2004-04-22 09:02 UTC, Julie Brandon
Details
Updated setiwrapper script for running binary as seti user (setiwrapper,105 bytes, text/plain)
2004-04-22 09:03 UTC, Julie Brandon
Details
init.d script for using seti user & group, plus also fix for stopping bug (setiathome,2.33 KB, text/plain)
2004-04-22 12:13 UTC, Julie Brandon
Details
setiwrapper for running setiathome as seti user, and also delaying between invocations (setiwrapper,362 bytes, text/plain)
2004-04-22 12:19 UTC, Julie Brandon
Details
init.d script for using seti user & group, plus also fix for stopping bug (setiathome,2.33 KB, text/plain)
2004-05-01 05:12 UTC, Julie Brandon
Details
setiwrapper for running setiathome as seti user, and also delaying between invocations (setiwrapper,391 bytes, text/plain)
2004-05-01 05:16 UTC, Julie Brandon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivar Ylvisaker 2004-02-01 13:11:26 UTC
I merged setiathome supposedly successfully.  I think that the files came from the University of Wisconsin but I am not sure.  But, then, setiathome would not start.  

Reproducible: Always
Steps to Reproduce:
1.  Tried /etc/init.d/setiathome start [or stop]
2.  Tried rebooting
3.

Actual Results:  
An error message appeared in setiathome.log.  setiathome did not start.

Expected Results:  
Start setiathome

The cause of the error appears to be two lines, both containing the word
setiwrapper, in the file that becomes /etc/init.d/setiathome.  A search of the
web implies that setiwrapper is used only on Windows NT systems.  I edited the
first of these lines, which starts setiathome, so that it executes
/opt/setiathome/setiathome.  Note that this command must be executed from the
/var/lib/setiathome directory, which is where the seti data is.  I deleted the
second line.  Now seti works as expected.
Comment 1 SpanKY gentoo-dev 2004-02-01 14:32:16 UTC
the wrapper was added to the portage package by myself
Comment 2 Alan 2004-02-02 11:05:35 UTC
Any chance of this showing up in stable any time soon?
Comment 3 SpanKY gentoo-dev 2004-02-02 11:18:29 UTC
ah, i see where i screwed up ...

i updated the 3.03-r1 ebuild to fix non-x86 arches but as a result i broke the 3.08-r1 ebuild ... i'll have this fixed up soon and probably release 3.08-r2
Comment 4 SpanKY gentoo-dev 2004-02-20 12:00:40 UTC
*** Bug 41737 has been marked as a duplicate of this bug. ***
Comment 5 Mr. P 2004-02-21 08:26:10 UTC
Created attachment 26049 [details]
corrected init.d - script.

There was an error, when the script wanted to start the application.
Put the new one in and it will function.

Much fun!
Comment 6 Ivar Ylvisaker 2004-02-21 10:59:23 UTC
There is a problem with Mr. P's /etc/init.d/setiathome script.  The ebuild script puts the setiathome executable in the /opt/setiathome directory, not in the SETIATHOME_DIR directory, which is usually /var/lib/setiathome.  The latter contains the datafiles.

There is one other potential difficulty.  If you start setiathome at boot, the user will normally be root.  However, the user of a setiathome control program such as tkseti is normally a user other than root; it is "ivar" in my case.  Hence, the control package to do some things like kill the running setiathome.  My solution is a line like the following in the /etc/init.d/setiathome script:

su ivar -c 'cd /var/lib/setiathome; /opt/setiathome/setiathome -graphics -nice 19  >& setiathome.log &'

Of course, you have to substitute your own user name for ivar.
Comment 7 Ivar Ylvisaker 2004-02-21 11:05:20 UTC
I mangled one sentence.  I should have said:

Hence, the control package can't do some things like kill the running setiathome.
Comment 8 SpanKY gentoo-dev 2004-03-04 03:32:30 UTC
*** Bug 43642 has been marked as a duplicate of this bug. ***
Comment 9 Marius Caldas 2004-03-04 16:21:59 UTC
Hello SpanKY,
I opened bug 43642 because the original description for this bug didn't seem to cover the problems I described at all. Are you sure they are related ?
Comment 10 SpanKY gentoo-dev 2004-03-04 20:33:18 UTC
in general i screwed up the init script for 3.08 while fixing 3.03

the init script needs to be rewritten ... most of your troubles are because of the threading stuff which is broken
Comment 11 Marius Caldas 2004-03-05 12:47:16 UTC
Ok, SpanKY, thanks for your effort!
Comment 12 SpanKY gentoo-dev 2004-03-05 20:01:17 UTC
*** Bug 43846 has been marked as a duplicate of this bug. ***
Comment 13 SpanKY gentoo-dev 2004-04-05 16:13:39 UTC
does setiathome-3.08-r2 address these (and any other) issues you guys had ?
Comment 14 Ivar Ylvisaker 2004-04-07 02:55:56 UTC
Setiathome will start now when installed using setiathome-3.08-r2.

However, I still had to modify the setiathome file in /etc/init.d so that the setiathome process will be owned by me and not by root when setiathome is started at bootup.  I also had to modify the permissions in the /var/lib/setiathome directory.
Comment 15 Dave Stead 2004-04-12 21:49:03 UTC
If the binary is under /opt then surely the data files should be under /var/opt not /var/lib

http://www.pathname.com/fhs/pub/fhs-2.3.html#VAROPTVARIABLEDATAFOROPT states "Variable data of the packages in /opt must be installed in /var/opt/<subdir>"
Comment 16 Jason Cox (RETIRED) gentoo-dev 2004-04-20 20:42:26 UTC
This problem still exists. I just tried the new setiathome, and am running into the same problems. I suspect the the setiwrapper script is at fault. ps shows two instances of setiwrapper running and only one setiathome. one instance of setiwrapper is taking up 100% of one CPU, while the other is taking up 0. The setiathome that is runnng is taking up all of the other cpu.
Comment 17 Julie Brandon 2004-04-22 09:02:06 UTC
Created attachment 29823 [details]
init.d script for using seti user & group, plus also fix for stopping bug
Comment 18 Julie Brandon 2004-04-22 09:03:25 UTC
Created attachment 29824 [details]
Updated setiwrapper script for running binary as seti user
Comment 19 Julie Brandon 2004-04-22 09:16:37 UTC
In my opinion the script is still broken anyway, twice over!

1)

"/etc/init.d/setiathome stop" will not work properly for people using the
setiwrapper, and will require the use of "/etc/init.d/setiathome zap" to
manually kill-off the "running" state of the service for a user to
ever be able to restart the script with "/etc/init.d/setiathome start"

This is because the lines in /etc/init.d/setiathome that presently read...

"
stop() {
        ebegin "Stopping SETI@home"
        killall setiwrapper
        killall setiathome
        eend $?
}
"

...will cause a failure return code everytime, because although killing setiwrapper will succeed, killing setiathome will not!

In my opinion the script here ought to read...

"
stop() {
        ebegin "Stopping SETI@home"
        killall setiwrapper || killall setiathome
        eend $?
}
"

...such that "killall setiathome" only gets run if "killall setiwrapper" failed.

See updated script attached.


2)

Others have commented here how running seti@home as root prevents them from getting at the stats from user-space programs.

Much more serious than that is that the script is running a *3RD PARTY BINARY* as *ROOT* totally *UNNECESSARILY*.  To run a service as root that doesn't need to be doing so is generally depreciated, but to be doing so with a binary where the source is unavailable is daft.  In my opinion, and I'm sure others will agree, the present config is an unnecessary potential security risk (more from the risk of the binary crashing and going bezerk and hurting anything it likes given that it is presently root!)

Could the ebuild not simply create seti user and group, and instead within setiwrapper use "su seti -c" to run setiathome binary, and "chown seti.seti" the directories and relevant files within "/etc/init.d/setiathome)?

This is how I currently have setiathome configured, this has the advantage of running seti as an otherwise totally unprivilidged user, with the binary totally unable to do any damage should it crash or have been compromised...

...and ALSO has the advantage that any users who want to get at the statistics with things like ksetispy (or whatever it is called) can just simply get themselves added to the seti group?

Again, see the attachments.

I have to say, without wishing to seem rude, I'm uncomfortable that this and the previous seti ebuilds are considered a stable release.  *8-/

Ta-ra,
  Julie

http://www.computergeeks.co.uk/
Comment 20 Julie Brandon 2004-04-22 12:13:22 UTC
Created attachment 29835 [details]
init.d script for using seti user & group, plus also fix for stopping bug

Ooops, the previous version of the script didn't work as expected, sorry,
doh... this version should neatly manually kill the setiwrappers and associated
children processes
Comment 21 Julie Brandon 2004-04-22 12:19:05 UTC
Created attachment 29836 [details]
setiwrapper for running setiathome as seti user, and also delaying between invocations

Previous version left in the apparently non-sensical "wait $?" command
(ummmm... wait until the process with the same number as the previous
return-code exits?) Runs setiathome as a "seti" user for security purposes. 
Also this version does a manual wait of one hour, before respawning setiathome
-- in keeping with seti@home policy (not supposed to respawn without a delay...
let's not get gentoo users into seti@homes bad books eh! ;-)
Comment 22 Stratos 2004-04-23 08:48:56 UTC
This bug is getting rather messy. Shouldn't different bug reports be filed on the different problems? Or should we expect a brand new working version of setup and init scripts, placing data files in /var/opt, running setiathome as an unprivileged seti user, and actually working with multiple processes? I was rather surprised to find a "stable" setup script that pretends to do things that actually don't work. If you know there are problems, why not just remove the parts that don't work, and stick with a very simple script that at least doesn't pretend to do anything fancy? No offense, but this is not a viable solution, and it seems it has been this way for a long time.

Anyway, I ended up here because I had the same problem running multiple instances as Marius Caldas. I found a very simple solution: Prevent /var/lib/setiathome/setiwrapper from changing directory! Ie. remove the line
cd $(dirname $0)
from the small script! /etc/init.d/setiathome does the job of changing directories anyway...
Comment 23 Julie Brandon 2004-05-01 05:12:56 UTC
Created attachment 30443 [details]
init.d script for using seti user & group, plus also fix for stopping bug
 


subtle bug fix, su will now correctly give the seti bin its appropriate extra
command line options (e.g. nice -19)
Comment 24 Julie Brandon 2004-05-01 05:16:44 UTC
Created attachment 30445 [details]
setiwrapper for running setiathome as seti user, and also delaying between invocations

subtle bug fix, su should now correctly give the seti bin its appropriate extra
command line options (e.g. nice -19)
Comment 25 Daniel Black (RETIRED) gentoo-dev 2004-09-03 07:16:54 UTC
Good one Julie
Comment 26 Ivar Ylvisaker 2004-11-10 00:06:05 UTC
The user of setiathome is still root in the latest version of Gentoo setiathome.  Hence, the seti gui programs such as Tk-SETI can monitor the progress of setiathome but cannot change it, e.g., they can't kill or pause or run it.

Ivar
Comment 27 Marcus D. Hanwell (RETIRED) gentoo-dev 2005-08-21 08:33:19 UTC
This has languished for a long time, probably longer than it should have. As  
version 3 is now obsolete and I have committed the boinc based version 4  
client to the portage tree I would appreciate you testing these. They use the  
boinc user and group and are hopefully much improved.  
  
I am closing this bug, but please open new bugs for any issues you encounter  
with the new setiathome client. The old ebuilds will be removed in due course  
as the clients no longer work and the SRC_URI is invalid. I can also be found 
in #gentoo-science if you would like to discuss the new setiathome ebuilds.