|
| Autostart af SETI Fra : Draxticore |
Dato : 10-03-02 02:07 |
|
Hej Unix gruppe.
Jeg har installeret Mandrake Linux 8.1.
Det er lykkedes mig at få installeret java 1.3.1, og dermed lave grundlaget
for at installere en java.baseret SETI cache.
Nu vil jeg gerne have startet SETI (og cache programmet) automatisk op.
Hvis det skal gøres før man overhovedet logger på (X), hvor skal jeg så
pille? Skal det være installeret af root, for at det kan lade sig gøre?
Hvis nu jeg vil sikre mig at det kører hele tiden, kan det så lade sig gøre
at forsøge at starte det via crontab i ny og næ? Eller er der en mere
korrekt måde at gøre det på?
M.v.h. Draxticore
| |
enrique (10-03-2002)
| Kommentar Fra : enrique |
Dato : 10-03-02 15:37 |
|
Yello
On Sun, 10 Mar 2002 02:07:10 +0100, Draxticore wrote:
> Hej Unix gruppe.
>
> Jeg har installeret Mandrake Linux 8.1. Det er lykkedes mig at få
> installeret java 1.3.1, og dermed lave grundlaget for at installere en
> java.baseret SETI cache. Nu vil jeg gerne have startet SETI (og cache
> programmet) automatisk op. Hvis det skal gøres før man overhovedet
> logger på (X), hvor skal jeg så pille? Skal det være installeret af
> root, for at det kan lade sig gøre? Hvis nu jeg vil sikre mig at det
> kører hele tiden, kan det så lade sig gøre at forsøge at starte det via
> crontab i ny og næ? Eller er der en mere korrekt måde at gøre det på?
Du kan starte det op i rcX.d (hvor X er din runlevel). Jeg har lavet et
start script, baseret på det script man kan finde på seti@home's
hjemmeside (sørg for at sætte stierne op osv. Det virker, men er langt
fra perfekt ;):
#!/bin/bash
# Author Henrik Farre <enrique@obel.auc.dk>
#
# Based on the work of:
# Author Stephane NICOLAS <snicolas@iad.ift.ulaval.ca>
#
# This program is distributed under the terms of the GPL.
#################################################
#
# chkconfig: 2345 99 80
# description: Controls the Seti@home client at boot time and shutdown.
#
# processname: setiathome
#
# Install Notes :
#
# Use chkconfig --add setiathome or
# make a symbolic link from /etc/inid.d/setiathome to
# /etc/rc.d/rc.<your run level>/S99seti
# to run this scipt at boot time, and
# /etc/rc.d/rc.6/K99seti
# to make it stop at shutdown (runlevel 6)
#
# 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"
################################################
# Source function librairy
.. /etc/init.d/functions
# 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/local/seti
# This direcory contains the root of setiathome's workspace
# you can customize it.
SETI_DIR=/usr/local/seti
# This file is generated by setiathome and we need it
SETI_LOG_FILE=/usr/local/seti/state.sah
# Create a lock file to ensure one and
# only one client is launched
SETI_LOCK_FILE=/var/lock/seti
function start(){
echo -n "Starting Seti@home: "
cd $SETI_DIR >/dev/null
$SETI_CLIENT_DIR/setiathome >/dev/null -proxy wwwproxy:3128 -graphics -nice 19 &
echo
RETVAL=$?
if test $RETVAL == 0; then
touch $SETI_LOCK_FILE
fi
echo
return $RETVAL
}
function stop(){
echo -n "Shutting down Seti@home: "
#more $SETI_DIR/user_info.sah | awk -F = ' $1 == "nresults" { print $2 }'
killproc setiathome
echo
rm -f $SETI_LOCK_FILE
return 0
}
function restart(){
stop
start
}
function status(){
running=`ps -A | grep setiathome`
if [[ ! -e /var/lock/seti ]]
then
echo "Seti@home client is not running"
else
echo -n "Seti@home client has been running in "
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 } '
echo -n "Total work units completed: "
more $SETI_DIR/user_info.sah | awk -F = ' $1 == "nresults" { print $2}'
echo -n "Last result returned at ("
more $SETI_DIR/user_info.sah | grep last_result_time | awk -F "(" '{ print $2 }'
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status
;;
*)
echo "Usage: seti {start|stop|restart|status}"
exit 1
esac
exit 0
--
Mvh. / Kind regards
Henrik Farre < enrique AT obel DOT auc DOT dk >
- If I where God, I would recompile the penguin with --enable-flying.
| |
|
|