From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: 111c93,111731b660d915a2 X-Google-Attributes: gid111c93,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newshub.sdsu.edu!elnk-nf2-pas!elnk-pas-nf1!newsfeed.earthlink.net!cyclone.socal.rr.com!cyclone2.kc.rr.com!news2.kc.rr.com!twister.rdc-kc.rr.com.POSTED!53ab2750!not-for-mail From: " DiskMan" Newsgroups: comp.os.linux.alpha References: Subject: Re: Seti@home X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: Date: Mon, 28 Feb 2005 21:47:56 GMT NNTP-Posting-Host: 65.28.70.117 X-Complaints-To: abuse@rr.com X-Trace: twister.rdc-kc.rr.com 1109627276 65.28.70.117 (Mon, 28 Feb 2005 15:47:56 CST) NNTP-Posting-Date: Mon, 28 Feb 2005 15:47:56 CST Organization: RoadRunner Xref: g2news1.google.com comp.os.linux.alpha:798 Oh, heres a initd script for ya if you like: #This script is a sample script to allow the seti # You have to link /etc/rc.d/rc./S99seti #When using the script, your seti client will always # -launched with "/etc/rc.d/initd/seti start" # -stoped with "/etc/rc.d/initd/seti stop" # -restarted with "/etc/rc.d/initd/seti restart" # -watched with "/etc/rc.d/initd/seti status" # -be logged with "/etc/rc.d/initd/seti log" # 30 0 * * * "/etc/rc.d/initd/seti log" SETI_CLIENT_DIR=/usr/scientific/setiathome-3.03 #This direcory contains the root of setiathome's workspace SETI_DIR=/usr/scientific/setiathome-3.03 #This file is generated by setiathome and we need it SETI_LOCK_FILE=/var/lock/seti.lock echo -n "Starting computing seti: " ${SETI_CLIENT_DIR}/setiathome -nice 15 -nolock -proxy 66.28.250.122 > /dev/null & echo -n "Shutting down seti: " killall setiathome running=`ps -A | grep setiathome` echo "Usage: seti {start|stop|restart|status}" [root@jericho em86-0.4]# cat /etc/rc.d/init.d/seti #!/bin/bash # chkconfig: 2345 30 60 # Source function library . /etc/rc.d/init.d/functions ################################################ #This script is a sample script to allow the seti #client to run as a service on a linux box. # #Install Notes : # # customize the two first variables of the script # make a symbolic link from # You have to link /etc/rc.d/rc./S99seti # to this file to make it run. # start the service (or reboot :-) ) # check it works with the status option # # #How this works ? # #When using the script, your seti client will always #run in the same folder (that you can choose) , #this is a "clean" way to run it. #The service can be: # -launched with "/etc/rc.d/initd/seti start" # -stoped with "/etc/rc.d/initd/seti stop" # -restarted with "/etc/rc.d/initd/seti restart" # -watched with "/etc/rc.d/initd/seti status" # -be logged with "/etc/rc.d/initd/seti log" #As the last option (log) in quite unsual, #it is intended to be used with the cron daemon #to allow users to log their progress in some file #so that can get a good idea of there current score #and progress. #Here are the 2 lines to type in your crontab : # SHELL=/bin/bash # 30 0 * * * "/etc/rc.d/initd/seti log" #You must have write permission on all the files #to add it to your crontab. #Author Stephane NICOLAS # #This program is distributed under the terms of the GPL. #You can get a copy of it at #http://www.fsf.org/copyleft/copyleft.html#translations ################################################ #This variable points to the client's executable directory #change this value to define the location of your client. #We do NOT need the client to be in your $PATH SETI_CLIENT_DIR=/usr/scientific/setiathome-3.03 #This direcory contains the root of setiathome's workspace #you can customize it. SETI_DIR=/usr/scientific/setiathome-3.03 #This file is generated by setiathome and we need it SETI_LOG_FILE=$SETI_DIR/state.sah #this file is lock file we create to ensure one and #only one client is launched SETI_LOCK_FILE=/var/lock/seti.lock case "$1" in start) echo -n "Starting computing seti: " more ${SETI_DIR}/user_info.sah | awk -F = '$1 == "nresults" { print $2}' cd $SETI_DIR ${SETI_CLIENT_DIR}/setiathome -nice 15 -nolock -proxy 66.28.250.122 > /dev/null & touch $SETI_LOCK_FILE ;; stop) echo -n "Shutting down seti: " more ${SETI_DIR}/user_info.sah | awk -F = ' $1 == "nresults" { print $2 }' killall setiathome rm -f $SETI_LOCK_FILE echo ;; restart) $0 stop $0 start ;; status) echo -n "Seti work unit completed: " more ${SETI_DIR}/user_info.sah | awk -F = ' $1 == "nresults" { print $2}' running=`ps -A | grep setiathome` #thanks to Toan for this bug fix if( [ "${running}" = " " ] ) then echo "Seti client is not running." else echo -n "Seti client runs since " echo ${running} | awk -F " " '{ print $3 }' echo -n "The current work unit is completed at " more $SETI_LOG_FILE | grep prog | awk -F "=" '{ print $2 } ' fi echo -n "Last result returned at (" more ${SETI_DIR}/user_info.sah | grep last_result_time | awk -F "(" '{ print $2 }' echo "" ;; log) /bin/date >> $SETI_DIR/log $0 status >> $SETI_DIR/log echo "*******************************************" >> $SETI_DIR/log ;; *) echo "Usage: seti {start|stop|restart|status}" exit 1 esac