wok annotate collectd/stuff/collectd @ rev 18415

Add sc-im
author Paul Issott <paul@slitaz.org>
date Sun Sep 20 16:19:59 2015 +0100 (2015-09-20)
parents
children 7f188676b59c
rev   line source
pascal@11218 1 #!/bin/sh
pascal@11218 2 # /etc/init.d/collectd : Start, stop and restart Collectd server on SliTaz, at
pascal@11218 3 # boot time or with the command line.
pascal@11218 4 #
pascal@11218 5 # To start Collectd server at boot time, just put collectd in the $RUN_DAEMONS
pascal@11218 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
pascal@11218 7 #
pascal@11218 8 . /etc/init.d/rc.functions
pascal@11218 9 . /etc/daemons.conf
pascal@11218 10
pascal@11218 11 NAME=collectd
pascal@11218 12 DESC="Statistics collection daemon"
pascal@11218 13 DAEMON=/usr/sbin/collectd
pascal@11218 14 OPTIONS=""
pascal@11218 15 PIDFILE=/var/run/collectd.pid
pascal@11218 16
pascal@11218 17 case "$1" in
pascal@11218 18 start)
pascal@11218 19 if active_pidfile $PIDFILE collectd ; then
pascal@11218 20 echo "$NAME already running."
pascal@11218 21 exit 1
pascal@11218 22 fi
pascal@11218 23 echo -n "Starting $DESC: $NAME... "
pascal@11218 24 $DAEMON $OPTIONS
pascal@11218 25 status
pascal@11218 26 ;;
pascal@11218 27 stop)
pascal@11218 28 if ! active_pidfile $PIDFILE collectd ; then
pascal@11218 29 echo "$NAME is not running."
pascal@11218 30 exit 1
pascal@11218 31 fi
pascal@11218 32 echo -n "Stopping $DESC: $NAME... "
pascal@11218 33 kill `cat $PIDFILE`
pascal@11218 34 status
pascal@11218 35 ;;
pascal@11218 36 restart)
pascal@11218 37 if ! active_pidfile $PIDFILE collectd ; then
pascal@11218 38 echo "$NAME is not running."
pascal@11218 39 exit 1
pascal@11218 40 fi
pascal@11218 41 echo -n "Restarting $DESC: $NAME... "
pascal@11218 42 kill `cat $PIDFILE`
pascal@11218 43 sleep 2
pascal@11218 44 $DAEMON $OPTIONS
pascal@11218 45 status
pascal@11218 46 ;;
pascal@11218 47 *)
pascal@11218 48 echo ""
pascal@11218 49 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
pascal@11218 50 echo ""
pascal@11218 51 exit 1
pascal@11218 52 ;;
pascal@11218 53 esac
pascal@11218 54
pascal@11218 55 exit 0