init script for gacks collector
smbaker [Wed, 12 Sep 2012 19:29:36 +0000 (12:29 -0700)]
apps/gacks/gackscollector.init [new file with mode: 0755]

diff --git a/apps/gacks/gackscollector.init b/apps/gacks/gackscollector.init
new file mode 100755 (executable)
index 0000000..5fbc786
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/sh
+#
+# gackscollector.init      Starts gacks collector
+#
+# chkconfig: 2345 95 35
+# description: Starts and stops gacks collector
+#
+### BEGIN INIT INFO
+# Provides: $gackscollector
+
+# Source function library.
+. /etc/init.d/functions
+
+if [ ! -f /usr/local/gackscentral/bin/gackscollector.py ]; then
+   echo "missing gackscollector.py"
+   exit 0
+fi
+
+
+start() {
+        chmod +x /usr/local/gackscentral/bin/gackscollector.py
+       echo -n $"Starting gacks collector: "
+        cd /usr/local/gackscentral/bin
+        python ./gackscollector.py start
+        echo
+}
+
+stop() {
+       echo -n $"Shutting down gacks collector: "
+        cd /usr/local/gackscentral/bin
+        python ./gackscollector.py stop
+        echo
+        return 0
+}
+
+restart() {
+       echo -n $"Restarting gacks collector: "
+        cd /usr/local/gackscentral/bin
+        python ./gackscollector.py restart
+        echo
+        return 0
+}
+
+hup() {
+        echo "Sorry, not implemented..."
+}
+
+rhstatus() {
+        echo "Sorry, not implemented..."
+}
+
+
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart|reload|condrestart)
+       restart
+       ;;
+  hup)
+       hup
+       ;;
+  status)
+       rhstatus
+       ;;
+  *)
+       echo $"Usage: $0 {start|stop|restart|reload|condrestart|hup|status}"
+       exit 1
+esac
+
+exit $?