]>
Commit | Line | Data |
---|---|---|
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. | |
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 | ||
3f83198c | 26 | CLIENT_HOME=/var/lib/zope |
8bc946c6 | 27 | |
28 | RETVAL=0 | |
29 | ||
30 | # See how we were called. | |
31 | case "$1" in | |
9eea75be | 32 | start) |
8bc946c6 | 33 | if [ -f /var/lock/subsys/zope ]; then |
9eea75be | 34 | msg_already_running Zope |
8bc946c6 | 35 | else |
36 | msg_starting Zope | |
37 | busy | |
38 | daemon zope-zserver | |
39 | RETVAL=$?; | |
40 | sleep 5 | |
41 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zope | |
42 | fi | |
43 | ;; | |
44 | stop) | |
9eea75be | 45 | if [ -f /var/lock/subsys/zope ]; then |
46 | msg_stopping Zope | |
47 | kill `cat ${CLIENT_HOME}/Z2.pid` | |
8bc946c6 | 48 | sleep 1 |
49 | deltext | |
50 | ok | |
9eea75be | 51 | rm -f /var/lock/subsys/zope >/dev/null 2>&1 |
52 | else | |
53 | msg_not_running Zope | |
54 | exit 1 | |
55 | fi | |
8bc946c6 | 56 | ;; |
57 | status) | |
3f83198c | 58 | if ps -p `cat ${CLIENT_HOME}/Z2.pid | awk '{print $2}'` >/dev/null; then |
9eea75be | 59 | RETVAL=$? |
60 | nls "Zope (pid %s) is running" "`cat ${CLIENT_HOME}/Z2.pid`" | |
8bc946c6 | 61 | else |
9eea75be | 62 | msg_not_running Zope |
63 | RETVAL=1 | |
8bc946c6 | 64 | fi |
8bc946c6 | 65 | ;; |
9eea75be | 66 | restart|reload) |
8bc946c6 | 67 | $0 stop |
68 | $0 start | |
69 | ;; | |
70 | *) | |
92684bdc | 71 | msg_usage "$0 {start|stop|restart|reload|status}" |
8bc946c6 | 72 | exit 1 |
73 | ;; | |
74 | esac | |
75 | ||
76 | exit $RETVAL |