#!/bin/sh # RedHat startup script for a ZEO server using zeoctl # # chkconfig: 2345 80 20 # description: ZEO (Zope Enterprise Objects) zeoctls=$(ls /var/lib/erp5/zeo_server*/bin/zeoctl 2>/dev/null) name="zeo_server" [ -f $zeoctl ] || exit 1 RETVAL=0 start() { n=1 for zeoctl in $zeoctls; do echo -n "Starting $name $n: " "$zeoctl" start 2> /dev/null RETVAL=$? echo n=$(($n+1)) done return $RETVAL } stop() { n=1 for zeoctl in $zeoctls; do echo -n "Stoping $name $n: " "$zeoctl" stop 2> /dev/null RETVAL=$? echo n=$(($n+1)) done return $RETVAL } status() { n=1 for zeoctl in $zeoctls; do echo -n "Checking $name $n: " "$zeoctl" status 2> /dev/null RETVAL=$? echo n=$(($n+1)) done return $RETVAL } logreopen() { n=1 for zeoctl in $zeoctls; do echo -n "Reopening the log file in $name $n: " "$zeoctl" logreopen 2> /dev/null RETVAL=$? echo n=$(($n+1)) done return $RETVAL } case "$1" in start) start ;; stop) stop ;; status) status ;; logreopen) logreopen ;; restart) stop start ;; *) echo "Usage: $0 {start|stop|status|logreopen|restart}" exit 1 esac exit $REVAL