]>
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 | ||
3f83198c | 13 | CLIENT_HOME=/var/lib/zope |
8bc946c6 | 14 | |
15 | RETVAL=0 | |
16 | ||
17 | # See how we were called. | |
18 | case "$1" in | |
9eea75be | 19 | start) |
8bc946c6 | 20 | if [ -f /var/lock/subsys/zope ]; then |
9eea75be | 21 | msg_already_running Zope |
8bc946c6 | 22 | else |
23 | msg_starting Zope | |
24 | busy | |
25 | daemon zope-zserver | |
26 | RETVAL=$?; | |
27 | sleep 5 | |
28 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zope | |
29 | fi | |
30 | ;; | |
31 | stop) | |
9eea75be | 32 | if [ -f /var/lock/subsys/zope ]; then |
33 | msg_stopping Zope | |
34 | kill `cat ${CLIENT_HOME}/Z2.pid` | |
8bc946c6 | 35 | sleep 1 |
36 | deltext | |
37 | ok | |
9eea75be | 38 | rm -f /var/lock/subsys/zope >/dev/null 2>&1 |
39 | else | |
40 | msg_not_running Zope | |
41 | exit 1 | |
42 | fi | |
8bc946c6 | 43 | ;; |
44 | status) | |
3f83198c | 45 | if ps -p `cat ${CLIENT_HOME}/Z2.pid | awk '{print $2}'` >/dev/null; then |
9eea75be | 46 | RETVAL=$? |
47 | nls "Zope (pid %s) is running" "`cat ${CLIENT_HOME}/Z2.pid`" | |
8bc946c6 | 48 | else |
9eea75be | 49 | msg_not_running Zope |
50 | RETVAL=1 | |
8bc946c6 | 51 | fi |
8bc946c6 | 52 | ;; |
9eea75be | 53 | restart|reload) |
8bc946c6 | 54 | $0 stop |
55 | $0 start | |
56 | ;; | |
57 | *) | |
9eea75be | 58 | msg_Usage "$0 {start|stop||restart|reload|status}" |
8bc946c6 | 59 | exit 1 |
60 | ;; | |
61 | esac | |
62 | ||
63 | exit $RETVAL |