Improve SLC RPM
authorMathieu Baudier <mbaudier@argeo.org>
Mon, 14 Nov 2011 15:51:50 +0000 (15:51 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Mon, 14 Nov 2011 15:51:50 +0000 (15:51 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@4907 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

dist/slc/src/main/rpm/etc/init.d/slc

index 13c272c30aaafdbacff74a79ba0c7095772fc824..ef7534ec56864d622aefc8446fc09584abde140a 100644 (file)
@@ -1,42 +1,31 @@
 #!/bin/bash
 #
-# slc-server   SLC Server
+# slc  Argeo SLC
 #
 # chkconfig: 3 92 92
-# description: SLC Server
+# description: Argeo SLC (http://www.argeo.org)
 
 # Source function library.
-. /etc/rc.d/init.d/functions
+. /etc/osgiboot/osgi-service-init-functions.sh
 
-RETVAL=0
+# Application id (must be in line with header)
+APP=slc
 
-start() {
-       /usr/sbin/osgi-service slc start
-       action $"Start SLC" /bin/true
-       return $RETVAL
-}
-
-stop() {
-       /usr/sbin/osgi-service slc stop
-       action $"Stop SLC" /bin/true
-       return $RETVAL
-}
-
-# See how we were called.
+# main
 case "$1" in
   start)
-        start
+        osgi_service_start $APP
         ;;
   stop)
-        stop
+        osgi_service_stop $APP
         ;;
   restart)
-        stop
-        start
+        osgi_service_stop $APP
+        osgi_service_start $APP
         RETVAL=$?
         ;;
   status)
-               /usr/sbin/osgi-service slc-server status
+        osgi_service_status $APP
         ;;
   *)
         echo $"Usage: $0 {start|stop|restart|status}"