]> git.pld-linux.org Git - packages/Zope.git/blame - Zope.init
- revert user changes
[packages/Zope.git] / Zope.init
CommitLineData
8bc946c6 1#!/bin/sh
2#
9eea75be 3# zope Start/Stop the Zope web-application server.
8bc946c6 4#
5# chkconfig: 2345 72 72
9eea75be 6# description: zope is a web server specifically for handling \
7# HTTP requests to the Zope web-application service.
8bc946c6 8# probe: true
9
10# Source function library.
11. /etc/rc.d/init.d/functions
12
92684bdc 13# Source networking configuration.
14. /etc/sysconfig/network
15
16# Check that networking is up.
17if is_yes "${NETWORKING}"; then
18 if [ ! -f /var/lock/subsys/network ]; then
19 msg_network_down Zope
20 exit 1
21 fi
22else
23 exit 0
24fi
25
3f83198c 26CLIENT_HOME=/var/lib/zope
ac4a49a8 27PIDFILE=${CLIENT_HOME}/Z2.pid
8bc946c6 28
29RETVAL=0
8bc946c6 30# See how we were called.
31case "$1" in
9eea75be 32 start)
ac4a49a8 33 if [ ! -f /var/lock/subsys/zope ]; then
8bc946c6 34 msg_starting Zope
8bc946c6 35 daemon zope-zserver
36 RETVAL=$?;
37 sleep 5
38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zope
ac4a49a8 39 else
40 msg_already_running Zope
8bc946c6 41 fi
42 ;;
43 stop)
9eea75be 44 if [ -f /var/lock/subsys/zope ]; then
45 msg_stopping Zope
ac4a49a8 46 busy
9eea75be 47 kill `cat ${CLIENT_HOME}/Z2.pid`
ac4a49a8 48 RET=$?
8bc946c6 49 sleep 1
ac4a49a8 50 [ $RET -eq 0 ] && ok || died
51 rm -f /var/lock/subsys/zope ${CLIENT_HOME}/Z2.pid >/dev/null 2>&1
9eea75be 52 else
53 msg_not_running Zope
9eea75be 54 fi
8bc946c6 55 ;;
56 status)
ac4a49a8 57 if [ -f $PIDFILE ]; then
58 if ps -p `cat $PIDFILE` >/dev/null; then
59 RETVAL=$?
60 nls "%s (pid %s) is running..." Zope "`cat $PIDFILE`"
61 else
62 nls "%s dead but pid file exists" Zope
63 RETVAL=1
64 fi
65 else
66 if [ -f /var/lock/subsys/zope ]; then
67 nls "%s dead but subsys locked" Zope
68 RETVAL=2
69 else
70 nls "%s is stopped" Zope
71 RETVAL=3
72 fi
8bc946c6 73 fi
8bc946c6 74 ;;
ac4a49a8 75 restart|force-reload)
8bc946c6 76 $0 stop
77 $0 start
ac4a49a8 78 exit $?
8bc946c6 79 ;;
80 *)
ac4a49a8 81 msg_usage "$0 {start|stop|restart|force-reload|status}"
82 exit 3
8bc946c6 83 ;;
84esac
85
86exit $RETVAL
This page took 0.056092 seconds and 4 git commands to generate.