summaryrefslogtreecommitdiffstats
path: root/zope/F-13/zope.init.in
diff options
context:
space:
mode:
authorRobin Lee <robinlee.sysu@gmail.com>2010-06-17 17:29:27 +0800
committerRobin Lee <robinlee.sysu@gmail.com>2010-06-17 17:29:27 +0800
commitbb0b1c71aa5dc9c80a4e859a0f1cdc327d67e399 (patch)
tree8fd3d1b0c9624e8ceaab7451ae1181c8888499d4 /zope/F-13/zope.init.in
parent93cb6defcdc7d882152772168e300a0b0c7da644 (diff)
downloadrpm-bb0b1c71aa5dc9c80a4e859a0f1cdc327d67e399.tar.gz
rpm-bb0b1c71aa5dc9c80a4e859a0f1cdc327d67e399.tar.xz
rpm-bb0b1c71aa5dc9c80a4e859a0f1cdc327d67e399.zip
zope 2.10.9-1 from Jonathan Steffan <jon a fedoraunity.org>
Diffstat (limited to 'zope/F-13/zope.init.in')
-rw-r--r--zope/F-13/zope.init.in83
1 files changed, 83 insertions, 0 deletions
diff --git a/zope/F-13/zope.init.in b/zope/F-13/zope.init.in
new file mode 100644
index 0000000..1fd5751
--- /dev/null
+++ b/zope/F-13/zope.init.in
@@ -0,0 +1,83 @@
+#!/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