added one-liner for easy copy/paste
[gnt-info] / init.d / gnt-monitor
index 1abeb8e..baddadc 100755 (executable)
@@ -1,8 +1,8 @@
 #! /bin/sh
 ### BEGIN INIT INFO
 # Provides:          gnt-monitor
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
+# Required-Start:    $remote_fs $syslog $ganeti
+# Required-Stop:     $remote_fs $syslog $ganeti
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
 # Short-Description: Example initscript
 
 # PATH should only include /usr/* if it runs after the mountnfs.sh script
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
-DESC="Genti monitor to influxdb"
+DESC="Genti monitor"
 NAME=gnt-monitor
 DAEMON=/etc/ganeti/$NAME
-DAEMON_ARGS="--options args"
+DAEMON_ARGS=""
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
@@ -31,6 +31,11 @@ SCRIPTNAME=/etc/init.d/$NAME
 
 # Read configuration variable file if it is present
 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
+export DEBUG
+export INFLUX
+export INTERVAL
+export DC
+export RACK
 
 # Load the VERBOSE setting and other rcS variables
 . /lib/init/vars.sh
@@ -51,7 +56,7 @@ do_start()
        #   2 if daemon could not be started
        #start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
        #       || return 1
-       start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --background -- \
+       start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --background --make-pidfile -- \
                $DAEMON_ARGS \
                || return 2
        # Add code here, if necessary, that waits for the process to be ready