This repository has been archived by the owner on Apr 12, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Standardized naming to make things more specific. - Old carbon init script is now called carbon-cache. - Adding carbon-relay and carbon-aggregator support.
- Loading branch information
Showing
8 changed files
with
215 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/sh | ||
# | ||
# carbon-aggregator init file for starting up the carbon-aggregator daemon | ||
# | ||
# chkconfig: - 20 80 | ||
# description: Starts and stops the carbon-aggregator daemon. | ||
|
||
# Source function library. | ||
. /etc/rc.d/init.d/functions | ||
|
||
exec="/usr/bin/carbon-aggregator.py" | ||
pidfile="/var/run/carbon-aggregator.pid" | ||
|
||
CONFIG="/etc/carbon/carbon.conf" | ||
LOG_DIR="/var/log/carbon-aggregator" | ||
|
||
[ -e /etc/sysconfig/carbon-aggregator ] && . /etc/sysconfig/carbon-aggregator | ||
|
||
lockfile=/var/lock/subsys/carbon-aggregator | ||
|
||
start() { | ||
[ -f $CONFIG ] || exit 6 | ||
[ -x $exec ] || exit 5 | ||
echo -n $"Starting `basename $exec`: " | ||
daemon "$exec --config=$CONFIG --pidfile=$pidfile --logdir=$LOG_DIR start" | ||
retval=$? | ||
echo | ||
[ $retval -eq 0 ] && touch $lockfile | ||
return $retval | ||
} | ||
|
||
stop() { | ||
echo -n $"Stopping `basename $exec`: " | ||
killproc -p $pidfile `basename $exec` | ||
retval=$? | ||
echo | ||
[ $retval -eq 0 ] && rm -f $lockfile | ||
return $retval | ||
} | ||
|
||
restart() { | ||
stop | ||
start | ||
} | ||
|
||
rh_status() { | ||
status -p $pidfile `basename $exec` | ||
} | ||
|
||
rh_status_q() { | ||
rh_status >/dev/null 2>&1 | ||
} | ||
|
||
case "$1" in | ||
start) | ||
rh_status_q && exit 0 | ||
$1 | ||
;; | ||
stop) | ||
rh_status_q || exit 0 | ||
$1 | ||
;; | ||
restart) | ||
$1 | ||
;; | ||
status) | ||
rh_status | ||
;; | ||
condrestart|try-restart) | ||
rh_status_q || exit 0 | ||
restart | ||
;; | ||
*) | ||
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}" | ||
exit 2 | ||
esac | ||
exit $? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Configuration file for carbon-aggregator | ||
|
||
# CONFIG=/etc/carbon/carbon.conf | ||
# LOG_DIR=/var/log/carbon-aggregator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Configuration file for carbon-cache | ||
|
||
# CONFIG=/etc/carbon/carbon.conf | ||
# LOG_DIR=/var/log/carbon-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/sh | ||
# | ||
# carbon-relay init file for starting up the carbon-relay daemon | ||
# | ||
# chkconfig: - 20 80 | ||
# description: Starts and stops the carbon-relay daemon. | ||
|
||
# Source function library. | ||
. /etc/rc.d/init.d/functions | ||
|
||
exec="/usr/bin/carbon-relay.py" | ||
pidfile="/var/run/carbon-relay.pid" | ||
|
||
CONFIG="/etc/carbon/carbon.conf" | ||
LOG_DIR="/var/log/carbon-relay" | ||
|
||
[ -e /etc/sysconfig/carbon-relay ] && . /etc/sysconfig/carbon-relay | ||
|
||
lockfile=/var/lock/subsys/carbon-relay | ||
|
||
start() { | ||
[ -f $CONFIG ] || exit 6 | ||
[ -x $exec ] || exit 5 | ||
echo -n $"Starting `basename $exec`: " | ||
daemon "$exec --config=$CONFIG --pidfile=$pidfile --logdir=$LOG_DIR start" | ||
retval=$? | ||
echo | ||
[ $retval -eq 0 ] && touch $lockfile | ||
return $retval | ||
} | ||
|
||
stop() { | ||
echo -n $"Stopping `basename $exec`: " | ||
killproc -p $pidfile `basename $exec` | ||
retval=$? | ||
echo | ||
[ $retval -eq 0 ] && rm -f $lockfile | ||
return $retval | ||
} | ||
|
||
restart() { | ||
stop | ||
start | ||
} | ||
|
||
rh_status() { | ||
status -p $pidfile `basename $exec` | ||
} | ||
|
||
rh_status_q() { | ||
rh_status >/dev/null 2>&1 | ||
} | ||
|
||
case "$1" in | ||
start) | ||
rh_status_q && exit 0 | ||
$1 | ||
;; | ||
stop) | ||
rh_status_q || exit 0 | ||
$1 | ||
;; | ||
restart) | ||
$1 | ||
;; | ||
status) | ||
rh_status | ||
;; | ||
condrestart|try-restart) | ||
rh_status_q || exit 0 | ||
restart | ||
;; | ||
*) | ||
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}" | ||
exit 2 | ||
esac | ||
exit $? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Configuration file for carbon-relay | ||
|
||
# CONFIG=/etc/carbon/carbon.conf | ||
# LOG_DIR=/var/log/carbon-relay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.