]> git.pld-linux.org Git - packages/Zope.git/commitdiff
- LSB conformance changes
authorankry <ankry@pld-linux.org>
Thu, 15 May 2003 21:28:05 +0000 (21:28 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    Zope.init -> 1.5

Zope.init

index 1443d58917813498c7c9c587f3342a1287ef6a17..8da83c0b94721b770159ae788825361e462e53e6 100644 (file)
--- a/Zope.init
+++ b/Zope.init
@@ -24,52 +24,62 @@ else
 fi
 
 CLIENT_HOME=/var/lib/zope
+PIDFILE=${CLIENT_HOME}/Z2.pid
 
 RETVAL=0
-
 # See how we were called.
 case "$1" in
   start)
-       if [ -f /var/lock/subsys/zope ]; then
-               msg_already_running Zope
-       else    
+       if [ ! -f /var/lock/subsys/zope ]; then
                msg_starting Zope
-               busy
                daemon zope-zserver
                RETVAL=$?;
                sleep 5
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zope
+       else    
+               msg_already_running Zope
        fi
        ;;
   stop)
        if [ -f /var/lock/subsys/zope ]; then
                msg_stopping Zope
+               busy
                kill `cat ${CLIENT_HOME}/Z2.pid`
+               RET=$?
                sleep 1
-               deltext
-               ok
-               rm -f /var/lock/subsys/zope >/dev/null 2>&1
+               [ $RET -eq 0 ] && ok || died
+               rm -f /var/lock/subsys/zope ${CLIENT_HOME}/Z2.pid >/dev/null 2>&1
        else
                msg_not_running Zope
-               exit 1
        fi
        ;;
   status)
-       if ps -p `cat ${CLIENT_HOME}/Z2.pid | awk '{print $2}'` >/dev/null; then
-               RETVAL=$?
-               nls "Zope (pid %s) is running" "`cat ${CLIENT_HOME}/Z2.pid`"
-       else     
-               msg_not_running Zope
-               RETVAL=1
+       if [ -f $PIDFILE ]; then
+               if ps -p `cat $PIDFILE` >/dev/null; then
+                       RETVAL=$?
+                       nls "%s (pid %s) is running..." Zope "`cat $PIDFILE`"
+               else
+                       nls "%s dead but pid file exists" Zope
+                       RETVAL=1
+               fi
+       else
+               if [ -f /var/lock/subsys/zope ]; then
+                       nls "%s dead but subsys locked" Zope
+                       RETVAL=2
+               else
+                       nls "%s is stopped" Zope
+                       RETVAL=3
+               fi
        fi
        ;;
-  restart|reload)
+  restart|force-reload)
        $0 stop
        $0 start
+       exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|status}"
-       exit 1
+       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       exit 3
        ;;
 esac
 
This page took 0.050413 seconds and 4 git commands to generate.