rrda

REST API allowing to perform DNS queries over HTTP
Log | Files | Refs | README | LICENSE

rrda (1025B)


      1 #!/bin/sh
      2 
      3 ### BEGIN INIT INFO
      4 # Provides:          rrda
      5 # Required-Start:    $all
      6 # Required-Stop:     $all
      7 # Default-Start:     2 3 4 5
      8 # Default-Stop:      0 1 6
      9 # Short-Description: starts the rrda server
     10 # Description:       starts rrda using start-stop-daemon
     11 ### END INIT INFO
     12 
     13 PATH=/sbin:/bin:/usr/sbin:/usr/bin
     14 
     15 HOST=127.0.0.1
     16 PORT=8080
     17 
     18 DAEMON=rrda
     19 DAEMON_OPTS="-host=$HOST -port=$PORT"
     20 PIDFILE=/var/run/rrda.pid
     21 NAME=rrda
     22 
     23 USER=nobody
     24 GROUP=nogroup
     25 
     26 test -f $DAEMON || exit 0
     27 
     28 set -e
     29 
     30 case "$1" in
     31 	start)
     32 		echo -n "Starting rrda server: "
     33 		start-stop-daemon --start --chuid $USER:$GROUP \
     34 			--make-pidfile --background --pidfile $PIDFILE \
     35 			--exec $DAEMON -- $DAEMON_OPTS
     36 		echo "$NAME."
     37 		;;
     38 
     39 	stop)
     40 		echo -n "Stopping rrda server: "
     41 		start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
     42 		rm -f $PIDFILE
     43 		echo "$NAME."
     44 		;;
     45 
     46 	restart)
     47 		echo -n "Restarting rrda server:\n"
     48 		$0 stop
     49 		sleep 1
     50 		$0 start
     51 		;;
     52 
     53   	*)
     54 		echo "Usage: $NAME {start|stop|restart}" >&2
     55 		exit 1
     56 		;;
     57 esac
     58 
     59 exit 0