Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 26 lines (22 sloc) 0.785 kb
19fe6f9 Dave Barr tcollector.py: add pidfile option, add init script
davebarr authored
1 #!/bin/bash
2
3 # Semi Universal start-stop script
4
5 HOSTNAME=$(hostname)
6 PIDFILE=/var/run/tcollector.pid
7 PROG=/var/operations/tcollector/tcollector.py
8 ARGS="-c /var/operations/tcollector/collectors -H tsd.sv4.stumble.net -t host=$HOSTNAME -P $PIDFILE"
9
10 if [[ -x /sbin/start-stop-daemon ]]; then # Debian
11 case $1 in
12 start) start-stop-daemon --background --verbose --pidfile $PIDFILE --exec $PROG --start $PROG -- $ARGS
13 ;;
14 stop) start-stop-daemon --verbose --stop --pidfile $PIDFILE --startas $PROG
15 ;;
16 esac
17 elif [[ -f /etc/init.d/functions ]]; then # Centos
18 . /etc/init.d/functions
19 case $1 in
20 start) daemon --pidfile $PIDFILE "$PROG $ARGS &"
21 ;;
22 stop) killproc -p $PIDFILE $PROG
23 ;;
24 esac
25 fi
Something went wrong with that request. Please try again.