SETI as a "service" for Mac?

DarkMajiq

Diamond Member
Jun 11, 2000
3,408
0
0
Hey all you SETI Mac gurus, I'm wondering if there's any way to run the Mac CLI the same way as a service runs in Win 9X? I've been given permission to run it on my mum's Mac, but my brother also uses it, and he'll close it. I also suspect that as forgetful as she is, my mum would go "What's this?" and close it down too :) So, if anyone can help me out, it would be great, another few WUs per day for me, and of course for the TeAm :)
 

Anubis

No Lifer
Aug 31, 2001
78,712
427
126
tbqhwy.com
if your runnin OSX then you can run teh CLI version and hide it.

any other version of teh Mac OS and you have to run teh Screen saver one
 

DarkMajiq

Diamond Member
Jun 11, 2000
3,408
0
0
It's a brand new (or, rather, a couple of months old) eMac, I believe it has OS X. What exactly do I need to do to hide the SETI CLI? Also, is there any kind of SETI Driver type utility for Mac?
 

ViRGE

Elite Member, Moderator Emeritus
Oct 9, 1999
31,516
167
106
This is going to get a tad complex, but I bet you can wing it.;)

Editor's note: Most of these files are cobbled together from Dnet documentation, so they deserve credit here

These will be the nessisary instructions to set up SETI(The CLI of course) to lauch at bootup, basically turning it in to a daemon. You will need admin access to do this.

You must configure SETI first through the normal command line options(start it using ./setiathome) before you set this up.

In /Library/StartupItems, we are going to create a folder called "Seti". Inside that folder, we are going to create 2 text files(you will need BBEdit Lite, or another true text editor for this; TextEdit doesn't save in the right format). One will be "Seti" and the other called "StartupParameters.plist". Below is the content of the files:

[Seti]
#!/bin/sh

. /etc/rc.common

# Don't forget to change buffer/.ini file perms if you wish to run suid'd.

CLIENT_DIR="/Uers/Shared/seti"
CLIENT_FNAME="setiathome"
CLIENT_RUNAS="root" # specifiy the owner of the Seti process

if [ -x "${CLIENT_DIR}/${CLIENT_FNAME}" ]; then
# first announce what we are going to do.
ConsoleMessage "Starting Seti client"
# change directory so we get nicer ps listings.
wd=`pwd`
cd "${CLIENT_DIR}"
# now launch the client
sudo -u ${CLIENT_RUNAS} ./${CLIENT_FNAME} >/dev/null &
cd "$wd"
else
# announce what happened.
ConsoleMessage "Seti client disabled"
fi

[END]

[StartupParameters.plist]
{
Description = "Seti client";
Provides = ("setiathome");
Requires = ("Disks", "Resolver");
Uses = ("NFS", "Network Time");
OrderPreference = "None";
Messages =
{
start = "Starting Seti client";
stop = "Stopping Seti client";
};
}

[END]

Now for some notes:
You shouldn't need to modify StartupParameters.plist at all

As for Dnetc...
CLIENT_DIR is the directory the client is in; make sure it's correct ;)
CLIENT_FNAME is the name of the client itself; also make sure it's correct ;)
CLIENT_RUNAS is who the client will run as. I reccomend root to bypass all permission issues, as a specific user can get ugly.
The rest of it should be ok, although I'm going to explain one line just to make sense:
sudo -u ${CLIENT_RUNAS} ./${CLIENT_FNAME} > /dev/null &
This command actually starts the client. What will end up being executed is the following as root in the /Users/Shared/seti directory:
./setiathome > /dev/null &
This starts seti, pipes the output in to oblivion, and specifies it as a daemon.

Once you have these files set up, you can test it by executing the script(./seti) as root. If it's sucessful, the seti client will show up in the ps list(I reccomend ps -ax to see everything). This should be enough to wing it, although I'd be glad to offer any more help if you need it.