]> git.pld-linux.org Git - packages/Zope.git/blob - Zope.init
- initial rev
[packages/Zope.git] / Zope.init
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 ZOPE_HOME=/usr/lib/zope
14 INSTANCE_HOME=/var/lib/zope
15 INSTANCE_NAME=`basename ${INSTANCE_HOME}`
16
17 RETVAL=0
18
19 # See how we were called.
20 case "$1" in
21     start)
22         if [ -f /var/lock/subsys/zope ]; then
23                 msg_Already_Running Zope
24         else    
25                 msg_starting Zope
26                 busy
27                 daemon zope-zserver
28                 RETVAL=$?;
29                 sleep 5
30                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zope
31         fi
32         ;;
33   stop)
34         if [ -f /var/lock/subsys/zope ]; then
35                 msg_stopping Zope
36                 kill `cat ${INSTANCE_HOME}/Z2.pid`
37                 sleep 1
38                 deltext
39                 ok
40                 rm -f /var/lock/subsys/zope >/dev/null 2>&1
41         else
42                 msg_not_running Zope
43                 exit 1
44         fi
45         ;;
46   status)
47         if ps -p `cat ${INSTANCE_HOME}/Z2.pid | awk '{print $2}'` >/dev/null; then
48             RETVAL=$?
49             echo "Zope (pid `cat ${INSTANCE_HOME}/Z2.pid`) is running"
50         else     
51             msg_not_running Zope
52             RETVAL=1
53         fi
54     
55         ;;
56   restart)
57         $0 stop
58         $0 start
59         ;;
60   *)
61         msg_Usage "$0 {start|stop|status|restart}"
62         exit 1
63         ;;
64 esac
65
66 exit $RETVAL
This page took 0.080018 seconds and 4 git commands to generate.