[Zope-CVS] CVS: Products/Scheduler - clock.rc:1.1
Chris McDonough
chrism@zope.com
Mon, 21 Apr 2003 15:09:53 -0400
Update of /cvs-repository/Products/Scheduler
In directory cvs.zope.org:/tmp/cvs-serv2940
Added Files:
clock.rc
Log Message:
An RedHat compatible rc script for clock.py.
=== Added File Products/Scheduler/clock.rc ===
#!/bin/sh
# Startup script for a Zope clock
# by Chris McDonough (chrism@zope.com)
#
# chkconfig: 2345 85 15
# description: A clock to tickle a Zope instance every so often over RPC
# Source function library.
. /etc/rc.d/init.d/functions
NAME=zope_clock
CLOCK_USERNAME=admin
CLOCK_PWD=123
PYTHON="python2.2 -u"
CLOCK_SCRIPT=/home/chrism/projects/cte_buildout/opt/Scheduler/clock.py
SCHEDULER_PATH=/CTE2/portal_scheduler
SCHEDULER_NETHOST=http://localhost:8080
SCHEDULER_PERIOD=1800 # half an hour
CLOCK_OPTIONS="--quiet --period=$SCHEDULER_PERIOD --nethost=$SCHEDULER_NETHOST --scheduler_path=$SCHEDULER_PATH --auth=$CLOCK_USERNAME:$CLOCK_PWD --logfile=/var/log/$NAME.log --errfile=/var/log/$NAME_error.log"
[ -f $CLOCK_SCRIPT ] || exit 1
RETVAL=0
start() {
echo -n $"Starting $NAME: "
$PYTHON "$CLOCK_SCRIPT" $CLOCK_OPTIONS&
RETVAL=$?
PID=$!
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME
echo $PID > /var/run/$NAME.pid
return $RETVAL
}
stop() {
echo -n $"Stopping $NAME: "
kill `cat /var/run/$NAME.pid`
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit $REVAL