#!/bin/sh # # zope Start/Stop the Zope web-application server. # # chkconfig: 2345 72 72 # description: zope is a web server specifically for handling \ # HTTP requests to the Zope web-application service. # probe: true # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then msg_network_down Zope exit 1 fi else exit 0 fi CLIENT_HOME=/var/lib/zope PIDFILE=${CLIENT_HOME}/Z2.pid RETVAL=0 # See how we were called. case "$1" in start) if [ ! -f /var/lock/subsys/zope ]; then msg_starting Zope daemon zope-zserver RETVAL=$?; sleep 5 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zope else msg_already_running Zope fi ;; stop) if [ -f /var/lock/subsys/zope ]; then msg_stopping Zope busy kill `cat ${CLIENT_HOME}/Z2.pid` RET=$? sleep 1 [ $RET -eq 0 ] && ok || died rm -f /var/lock/subsys/zope ${CLIENT_HOME}/Z2.pid >/dev/null 2>&1 else msg_not_running Zope fi ;; status) if [ -f $PIDFILE ]; then if ps -p `cat $PIDFILE` >/dev/null; then RETVAL=$? nls "%s (pid %s) is running..." Zope "`cat $PIDFILE`" else nls "%s dead but pid file exists" Zope RETVAL=1 fi else if [ -f /var/lock/subsys/zope ]; then nls "%s dead but subsys locked" Zope RETVAL=2 else nls "%s is stopped" Zope RETVAL=3 fi fi ;; restart|force-reload) $0 stop $0 start exit $? ;; *) msg_usage "$0 {start|stop|restart|force-reload|status}" exit 3 ;; esac exit $RETVAL