This repository has been archived on 2026-01-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
zope/zope.init.in
Aurelien Bompard b91b264daa - update devel and FC-5 to 2.9.3
- add Hotfix_20060705 to devel, FC-5, FC-4 and FC-3
2006-07-10 13:03:07 +00:00

83 lines
1.6 KiB
Bash

#!/bin/sh
# Startup script for Zope
#
# chkconfig: - 80 20
# description: Zope, a web application server
#
# config: $instance/etc/zope.conf
# Source function library.
. /etc/init.d/functions
RETVAL=0
zopectl="<<BINDIR>>/zopectl"
user="<<ZOPE_USER>>"
prog="zope"
start() {
echo -n $"Starting $prog: "
output=`$zopectl -u $user start 2>/dev/null`
# the return status of zopectl is not reliable, we need to parse
# its output via substring match
if echo $output | grep -q "started"; then
# success
touch /var/lock/subsys/$prog
success
echo
RETVAL=0
else
# failed
failure
echo
RETVAL=1
fi
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
output=`$zopectl -u $user stop 2>/dev/null`
# the return status of zopectl is not reliable, we need to parse
# its output via substring match
if echo $output | grep -q "stopped"; then
# success
rm -f /var/lock/subsys/$prog
success
echo
RETVAL=0
else
# failed
failure
echo
RETVAL=1
fi
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
$zopectl status
;;
restart)
restart
;;
condrestart)
$zopectl status | grep -qs "program running" && restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
RETVAL=2
esac
exit $RETVAL