Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 43468d9fad
Fetching contributors…

Cannot retrieve contributors at this time

executable file 94 lines (80 sloc) 1.897 kb
#!/bin/bash
#
# pystatsd This shell script takes care of starting and stopping pystatsd.
#
# chkconfig: 2345 80 30
# description: Pystatsd is a front end/proxy for the Graphite stats collection and graphing server.
#
# processname: pystatsd
# config: /etc/sysconfig/pystatsd
# pidfile: /var/run/pystatsd.pid
### BEGIN INIT INFO
# Provides: pystatsd
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop pystatsd
# Description: Pystatsd is a front end/proxy for the Graphite stats collection and graphing server.
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
PIDFILE=/var/run/pystatsd.pid
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 1
[ -x /usr/bin/pystatsd-server ] || exit 5
prog="pystatsd"
start() {
# Start daemons.
ret=0
echo -n $"Starting $prog: "
daemon /usr/bin/pystatsd-server --daemon --pidfile $PIDFILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pystatsd
let ret+=$RETVAL
[ $ret -eq 0 ] && return 0 || return 1
}
stop() {
# Stop daemons.
echo -n $"Shutting down $prog: "
/usr/bin/pystatsd-server --stop --pidfile $PIDFILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/pystatsd
return $RETVAL
}
status -p $PIDFILE >/dev/null
running=$?
# See how we were called.
case "$1" in
start)
[ $running -eq 0 ] && exit 0
start
RETVAL=$?
;;
stop)
[ $running -eq 0 ] || exit 0
stop
RETVAL=$?
;;
restart|force-reload)
stop
start
RETVAL=$?
;;
condrestart|try-restart)
[ $running -eq 0 ] || exit 0
stop
start
RETVAL=$?
;;
status)
echo -n pystatsd; status -p $PIDFILE -l pystatsd
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
RETVAL=2
esac
exit $RETVAL
Jump to Line
Something went wrong with that request. Please try again.