]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/sh | |
2 | # | |
3 | # zope Start/Stop the Zope web-application server. | |
4 | # | |
5 | # chkconfig: 2345 72 72 | |
6 | # description: zope is a web server specifically for handling \ | |
7 | # HTTP requests to the Zope web-application service. | |
8 | # probe: true | |
9 | ||
10 | # Source function library. | |
11 | . /etc/rc.d/init.d/functions | |
12 | ||
13 | # Source networking configuration. | |
14 | . /etc/sysconfig/network | |
15 | ||
16 | # Check that networking is up. | |
17 | if is_yes "${NETWORKING}"; then | |
18 | if [ ! -f /var/lock/subsys/network ]; then | |
19 | msg_network_down Zope | |
20 | exit 1 | |
21 | fi | |
22 | else | |
23 | exit 0 | |
24 | fi | |
25 | ||
26 | CLIENT_HOME=/var/lib/zope | |
27 | PIDFILE=${CLIENT_HOME}/Z2.pid | |
28 | ||
29 | RETVAL=0 | |
30 | # See how we were called. | |
31 | case "$1" in | |
32 | start) | |
33 | if [ ! -f /var/lock/subsys/zope ]; then | |
34 | msg_starting Zope | |
35 | daemon zope-zserver | |
36 | RETVAL=$?; | |
37 | sleep 5 | |
38 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zope | |
39 | else | |
40 | msg_already_running Zope | |
41 | fi | |
42 | ;; | |
43 | stop) | |
44 | if [ -f /var/lock/subsys/zope ]; then | |
45 | msg_stopping Zope | |
46 | busy | |
47 | kill `cat ${CLIENT_HOME}/Z2.pid` | |
48 | RET=$? | |
49 | sleep 1 | |
50 | [ $RET -eq 0 ] && ok || died | |
51 | rm -f /var/lock/subsys/zope ${CLIENT_HOME}/Z2.pid >/dev/null 2>&1 | |
52 | else | |
53 | msg_not_running Zope | |
54 | fi | |
55 | ;; | |
56 | status) | |
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 | |
73 | fi | |
74 | ;; | |
75 | restart|force-reload) | |
76 | $0 stop | |
77 | $0 start | |
78 | exit $? | |
79 | ;; | |
80 | *) | |
81 | msg_usage "$0 {start|stop|restart|force-reload|status}" | |
82 | exit 3 | |
83 | ;; | |
84 | esac | |
85 | ||
86 | exit $RETVAL |