]> git.pld-linux.org Git - packages/carbon.git/blame - carbon-aggregator.init
package DATA_DIRS
[packages/carbon.git] / carbon-aggregator.init
CommitLineData
2a67e4b4 1#!/bin/bash
94b9e5fa
ER
2#
3# carbon-aggregator init file for starting up the carbon-aggregator daemon
4#
d6de23a6 5# chkconfig: 2345 20 80
94b9e5fa
ER
6# description: Starts and stops the carbon-aggregator daemon.
7
8# Source function library.
9. /etc/rc.d/init.d/functions
10
11exec="/usr/bin/carbon-aggregator"
12pidfile="/var/run/carbon-aggregator.pid"
13
14CONFIG="/etc/carbon/carbon.conf"
15LOG_DIR="/var/log/carbon"
16
17[ -e /etc/sysconfig/carbon ] && . /etc/sysconfig/carbon
18
19lockfile=/var/lock/subsys/carbon-aggregator
20
21start() {
22 [ -f $CONFIG ] || exit 6
23 [ -x $exec ] || exit 5
24 echo -n $"Starting `basename $exec`: "
25 daemon "$exec --config=$CONFIG --pidfile=$pidfile --logdir=$LOG_DIR start"
26 retval=$?
27 echo
28 [ $retval -eq 0 ] && touch $lockfile
29 return $retval
30}
31
32stop() {
33 echo -n $"Stopping `basename $exec`: "
34 killproc -p $pidfile `basename $exec`
35 retval=$?
36 echo
37 [ $retval -eq 0 ] && rm -f $lockfile
38 return $retval
39}
40
41restart() {
42 stop
43 start
44}
45
46reload() {
47 stop
48 start
49}
50
51rh_status() {
52 status -p $pidfile `basename $exec`
53}
54
55rh_status_q() {
56 rh_status >/dev/null 2>&1
57}
58
59case "$1" in
60 start)
61 rh_status_q && exit 0
62 $1
63 ;;
64 stop)
65 rh_status_q || exit 0
66 $1
67 ;;
68 restart)
69 $1
70 ;;
71 reload)
72 $1
73 ;;
74 status)
75 rh_status
76 ;;
77 condrestart|try-restart)
78 rh_status_q || exit 0
79 restart
80 ;;
81 *)
82 echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}"
83 exit 2
84esac
85exit $?
86
This page took 0.058657 seconds and 4 git commands to generate.