[csw-devel] SF.net SVN: gar:[13527] csw/mgar/pkg/lighttpd/trunk/files/cswlighttpd

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Wed Mar 2 11:21:44 CET 2011


Revision: 13527
          http://gar.svn.sourceforge.net/gar/?rev=13527&view=rev
Author:   wahwah
Date:     2011-03-02 10:21:43 +0000 (Wed, 02 Mar 2011)

Log Message:
-----------
lighttpd: Add 'restart' command support in SMF

When 'svcadm restart cswlighttpd' was issued, the service was going into
maintainance state.

Modified Paths:
--------------
    csw/mgar/pkg/lighttpd/trunk/files/cswlighttpd

Modified: csw/mgar/pkg/lighttpd/trunk/files/cswlighttpd
===================================================================
--- csw/mgar/pkg/lighttpd/trunk/files/cswlighttpd	2011-03-02 09:04:44 UTC (rev 13526)
+++ csw/mgar/pkg/lighttpd/trunk/files/cswlighttpd	2011-03-02 10:21:43 UTC (rev 13527)
@@ -13,8 +13,7 @@
 
 [ ! -f ${CONF_FILE} ] &&  exit $CONF_FILE
 
-case "$1" in
-start)
+start_service() {
         /bin/rm -f ${PIDFILE}
 # Enable NCA:
         NCAKMODCONF=/etc/nca/ncakmod.conf
@@ -25,19 +24,37 @@
             fi
         fi
         exec $HTTPD -f ${CONF_FILE} 2>&1
-        ;;
-refresh)
+}
+
+stop_service() {
         if [ -f "$PIDFILE" ]; then
+                /usr/bin/kill -QUIT `/usr/bin/cat $PIDFILE`
+        fi
+}
+
+refresh_service() {
+        if [ -f "$PIDFILE" ]; then
                 /usr/bin/kill -HUP `/usr/bin/cat $PIDFILE`
         fi
+}
+
+case "$1" in
+start)
+        start_service
         ;;
+refresh|reload)
+        refresh_service
+        ;;
 stop)
-        if [ -f "$PIDFILE" ]; then
-                /usr/bin/kill -QUIT `/usr/bin/cat $PIDFILE`
-        fi
+        stop_service
         ;;
+restart)
+        stop_service
+        sleep 1
+        start_service
+        ;;
 *)
-        echo "Usage: $0 {start|stop|refresh}"
+        echo "Usage: $0 {start|stop|refresh|reload|restart}"
         exit 1
         ;;
 esac


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list