Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit bd8911ed528c4c8556139fbc21c8d8ddc704c0f1 @jgoldschrafe jgoldschrafe committed Nov 7, 2011
@@ -0,0 +1,63 @@
+diff -ru carbon-0.9.7-upstream/bin/carbon-cache.py carbon-0.9.7/bin/carbon-cache.py
+--- carbon-0.9.7-upstream/bin/carbon-cache.py 2011-10-26 08:42:08.383714516 -0400
++++ carbon-0.9.7/bin/carbon-cache.py 2011-10-26 08:43:53.371572577 -0400
+@@ -38,10 +38,10 @@
+ # Figure out where we're installed
+ BIN_DIR = dirname( os.path.abspath(__file__) )
+ ROOT_DIR = dirname(BIN_DIR)
+-STORAGE_DIR = join(ROOT_DIR, 'storage')
+-LOG_DIR = join(STORAGE_DIR, 'log', 'carbon-cache')
++STORAGE_DIR = join('/var/lib/graphite')
++LOG_DIR = join('/var/log/graphite/carbon-cache')
+ LIB_DIR = join(ROOT_DIR, 'lib')
+-CONF_DIR = join(ROOT_DIR, 'conf')
++CONF_DIR = join('/etc/graphite')
+ __builtins__.CONF_DIR = CONF_DIR # evil I know, but effective.
+
+ sys.path.insert(0, LIB_DIR)
+diff -ru carbon-0.9.7-upstream/bin/carbon-relay.py carbon-0.9.7/bin/carbon-relay.py
+--- carbon-0.9.7-upstream/bin/carbon-relay.py 2011-10-26 08:42:08.383714516 -0400
++++ carbon-0.9.7/bin/carbon-relay.py 2011-10-26 08:44:42.040674649 -0400
+@@ -34,10 +34,10 @@
+ # Figure out where we're installed
+ BIN_DIR = dirname(__file__)
+ ROOT_DIR = dirname(BIN_DIR)
+-STORAGE_DIR = join(ROOT_DIR, 'storage')
+-LOG_DIR = join(STORAGE_DIR, 'log', 'carbon-relay')
++STORAGE_DIR = '/var/lib/graphite/storage'
++LOG_DIR = '/var/log/graphite/carbon-relay'
+ LIB_DIR = join(ROOT_DIR, 'lib')
+-CONF_DIR = join(ROOT_DIR, 'conf')
++CONF_DIR = '/etc/graphite'
+ __builtins__.CONF_DIR = CONF_DIR
+
+ sys.path.insert(0, LIB_DIR)
+diff -ru carbon-0.9.7-upstream/conf/carbon.conf.example carbon-0.9.7/conf/carbon.conf.example
+--- carbon-0.9.7-upstream/conf/carbon.conf.example 2011-10-26 08:42:08.384718077 -0400
++++ carbon-0.9.7/conf/carbon.conf.example 2011-10-26 18:36:34.973660754 -0400
+@@ -1,5 +1,5 @@
+ [cache]
+-LOCAL_DATA_DIR = /opt/graphite/storage/whisper/
++LOCAL_DATA_DIR = /var/lib/graphite/storage/whisper
+
+ # Specify the user to drop privileges to
+ # If this is blank carbon runs as the user that invokes it
+diff -ru carbon-0.9.7-upstream/lib/carbon/conf.py carbon-0.9.7/lib/carbon/conf.py
+--- carbon-0.9.7-upstream/lib/carbon/conf.py 2011-10-26 08:42:08.382731182 -0400
++++ carbon-0.9.7/lib/carbon/conf.py 2011-10-26 08:45:12.667505551 -0400
+@@ -16,7 +16,7 @@
+
+
+ defaults = dict(
+- LOCAL_DATA_DIR="/opt/graphite/storage/whisper/",
++ LOCAL_DATA_DIR="/var/lib/graphite/storage/whisper",
+ USER="",
+ MAX_CACHE_SIZE='inf',
+ MAX_UPDATES_PER_SECOND=1000,
+diff -ru carbon-0.9.7-upstream/setup.cfg carbon-0.9.7/setup.cfg
+--- carbon-0.9.7-upstream/setup.cfg 2011-10-26 08:42:08.384718077 -0400
++++ carbon-0.9.7/setup.cfg 2011-10-26 09:05:13.678679614 -0400
+@@ -1,3 +1 @@
+ [install]
+-prefix = /opt/graphite
+-install-lib = %(prefix)s/lib
@@ -0,0 +1,93 @@
+diff -ru carbon-0.9.9-upstream/bin/carbon-aggregator.py carbon-0.9.9/bin/carbon-aggregator.py
+--- carbon-0.9.9-upstream/bin/carbon-aggregator.py 2011-10-27 00:07:21.071745412 -0400
++++ carbon-0.9.9/bin/carbon-aggregator.py 2011-10-27 00:10:53.177673509 -0400
+@@ -18,12 +18,6 @@
+
+ # Figure out where we're installed
+ BIN_DIR = dirname(abspath(__file__))
+-ROOT_DIR = dirname(BIN_DIR)
+-
+-# Make sure that carbon's 'lib' dir is in the $PYTHONPATH if we're running from
+-# source.
+-LIB_DIR = join(ROOT_DIR, 'lib')
+-sys.path.insert(0, LIB_DIR)
+
+ from carbon.util import run_twistd_plugin
+
+diff -ru carbon-0.9.9-upstream/bin/carbon-cache.py carbon-0.9.9/bin/carbon-cache.py
+--- carbon-0.9.9-upstream/bin/carbon-cache.py 2011-10-27 00:07:21.072736509 -0400
++++ carbon-0.9.9/bin/carbon-cache.py 2011-10-27 00:10:43.592691077 -0400
+@@ -18,12 +18,6 @@
+
+ # Figure out where we're installed
+ BIN_DIR = dirname(abspath(__file__))
+-ROOT_DIR = dirname(BIN_DIR)
+-
+-# Make sure that carbon's 'lib' dir is in the $PYTHONPATH if we're running from
+-# source.
+-LIB_DIR = join(ROOT_DIR, 'lib')
+-sys.path.insert(0, LIB_DIR)
+
+ from carbon.util import run_twistd_plugin
+
+diff -ru carbon-0.9.9-upstream/bin/carbon-client.py carbon-0.9.9/bin/carbon-client.py
+--- carbon-0.9.9-upstream/bin/carbon-client.py 2011-10-27 00:07:21.072736509 -0400
++++ carbon-0.9.9/bin/carbon-client.py 2011-10-27 00:11:19.333710793 -0400
+@@ -20,15 +20,9 @@
+
+ # Figure out where we're installed
+ BIN_DIR = dirname(abspath(__file__))
+-ROOT_DIR = dirname(BIN_DIR)
+-CONF_DIR = join(ROOT_DIR, 'conf')
++CONF_DIR = '/etc/graphite'
+ default_relayrules = join(CONF_DIR, 'relay-rules.conf')
+
+-# Make sure that carbon's 'lib' dir is in the $PYTHONPATH if we're running from
+-# source.
+-LIB_DIR = join(ROOT_DIR, 'lib')
+-sys.path.insert(0, LIB_DIR)
+-
+ try:
+ from twisted.internet import epollreactor
+ epollreactor.install()
+diff -ru carbon-0.9.9-upstream/bin/carbon-relay.py carbon-0.9.9/bin/carbon-relay.py
+--- carbon-0.9.9-upstream/bin/carbon-relay.py 2011-10-27 00:07:21.071745412 -0400
++++ carbon-0.9.9/bin/carbon-relay.py 2011-10-27 00:11:30.761835058 -0400
+@@ -18,12 +18,6 @@
+
+ # Figure out where we're installed
+ BIN_DIR = dirname(abspath(__file__))
+-ROOT_DIR = dirname(BIN_DIR)
+-
+-# Make sure that carbon's 'lib' dir is in the $PYTHONPATH if we're running from
+-# source.
+-LIB_DIR = join(ROOT_DIR, 'lib')
+-sys.path.insert(0, LIB_DIR)
+
+ from carbon.util import run_twistd_plugin
+
+diff -ru carbon-0.9.9-upstream/bin/validate-storage-schemas.py carbon-0.9.9/bin/validate-storage-schemas.py
+--- carbon-0.9.9-upstream/bin/validate-storage-schemas.py 2011-10-27 00:07:21.071745412 -0400
++++ carbon-0.9.9/bin/validate-storage-schemas.py 2011-10-27 00:12:04.164576948 -0400
+@@ -18,13 +18,10 @@
+ import traceback
+
+ BIN_DIR = dirname(abspath(__file__))
+-ROOT_DIR = realpath( dirname(BIN_DIR) )
+-LIB_DIR = join(ROOT_DIR, 'lib')
+-sys.path.insert(0, LIB_DIR)
+
+ import carbon
+ from carbon.conf import settings
+-settings['CONF_DIR'] = realpath(join(dirname(__file__), '..', 'conf'))
++settings['CONF_DIR'] = '/etc/graphite'
+ from carbon.storage import loadStorageSchemas
+ from ConfigParser import ConfigParser
+
+diff -ru carbon-0.9.9-upstream/setup.cfg carbon-0.9.9/setup.cfg
+--- carbon-0.9.9-upstream/setup.cfg 2011-10-27 00:07:21.072736509 -0400
++++ carbon-0.9.9/setup.cfg 2011-10-27 00:07:50.289556754 -0400
+@@ -1,3 +1 @@
+ [install]
+-prefix = /opt/graphite
+-install-lib = %(prefix)s/lib
@@ -0,0 +1,81 @@
+#!/bin/bash
+#!/bin/bash
+#
+# uwsgi - This script starts and stops all configured uwsgi applications
+#
+# chkconfig: - 85 15
+# description: uWSGI is a program to run applications adhering to the
+# Web Server Gateway Interface.
+# processname: uwsgi
+# config: /etc/sysconfig/uwsgi
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "$NETWORKING" = "no" ] && exit 0
+
+exec="/usr/bin/carbon-aggregator.py"
+prog=$(basename "$exec")
+CARBON_CONFIG_PATH="/etc/graphite/carbon.conf"
+CARBON_AGGREGATOR_ARGS=""
+CARBON_AGGREGATOR_PIDFILE="/var/run/graphite/carbon-aggregator.pid"
+
+if [ -f /etc/sysconfig/carbon-aggregator ]; then
+ . /etc/sysconfig/carbon-aggregator
+fi
+
+restart() {
+ stop
+ start
+}
+
+rh_status() {
+ status -p "$CARBON_AGGREGATOR_PIDFILE" "$prog"
+}
+
+start() {
+ echo -n 'Starting carbon-aggregator...'
+ daemon --pidfile="$CARBON_AGGREGATOR_PIDFILE" "$exec" start $args \
+ --config="$CARBON_CONFIG_PATH" --pidfile="$CARBON_AGGREGATOR_PIDFILE" >/dev/null
+ retval=$?
+ echo
+ return $retval
+}
+
+stop() {
+ echo -n 'Stopping carbon-aggregator...'
+ killproc -p "$CARBON_AGGREGATOR_PIDFILE" "$prog"
+ retval=$?
+ echo
+ return $retval
+}
+
+case $1 in
+ condrestart|try-restart)
+ rh_status "$f" 2>/dev/null && restart "$f"
+ ;;
+ reload)
+ restart
+ ;;
+ restart)
+ restart
+ ;;
+ start)
+ start
+ ;;
+ status)
+ rh_status
+ ;;
+ status_q)
+ rh_status >/dev/null 2>&1
+ ;;
+ stop)
+ stop
+ ;;
+esac
+
+exit $?
@@ -0,0 +1,81 @@
+#!/bin/bash
+#!/bin/bash
+#
+# uwsgi - This script starts and stops all configured uwsgi applications
+#
+# chkconfig: - 85 15
+# description: uWSGI is a program to run applications adhering to the
+# Web Server Gateway Interface.
+# processname: uwsgi
+# config: /etc/sysconfig/uwsgi
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "$NETWORKING" = "no" ] && exit 0
+
+exec="/usr/bin/carbon-cache.py"
+prog=$(basename "$exec")
+CARBON_CONFIG_PATH="/etc/graphite/carbon.conf"
+CARBON_CACHE_ARGS=""
+CARBON_CACHE_PIDFILE="/var/run/graphite/carbon-cache.pid"
+
+if [ -f /etc/sysconfig/carbon-cache ]; then
+ . /etc/sysconfig/carbon-cache
+fi
+
+restart() {
+ stop
+ start
+}
+
+rh_status() {
+ status -p "$CARBON_CACHE_PIDFILE" "$prog"
+}
+
+start() {
+ echo -n 'Starting carbon-cache...'
+ daemon --pidfile="$CARBON_CACHE_PIDFILE" "$exec" start $args \
+ --config="$CARBON_CONFIG_PATH" --pidfile="$CARBON_CACHE_PIDFILE" >/dev/null
+ retval=$?
+ echo
+ return $retval
+}
+
+stop() {
+ echo -n 'Stopping carbon-cache...'
+ killproc -p "$CARBON_CACHE_PIDFILE" "$prog"
+ retval=$?
+ echo
+ return $retval
+}
+
+case $1 in
+ condrestart|try-restart)
+ rh_status "$f" 2>/dev/null && restart "$f"
+ ;;
+ reload)
+ restart
+ ;;
+ restart)
+ restart
+ ;;
+ start)
+ start
+ ;;
+ status)
+ rh_status
+ ;;
+ status_q)
+ rh_status >/dev/null 2>&1
+ ;;
+ stop)
+ stop
+ ;;
+esac
+
+exit $?
Oops, something went wrong.

0 comments on commit bd8911e

Please sign in to comment.