Skip to content

Commit

Permalink
adding pid file to carbon and making sure it runs as www-data user
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoav committed Jun 17, 2012
1 parent accea47 commit 409bd88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions config/carbon
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ touch /var/lock/carbon

GRAPHITE_HOME=/opt/graphite
CARBON_USER=www-data
PIDFILE=/var/run/carbon/carbon.pid

# Carry out specific functions when asked to by the system
case "$1" in
start)
echo "Starting script carbon "
su $CARBON_USER -c "cd $GRAPHITE_HOME"; su $CARBON_USR -c "$GRAPHITE_HOME/bin/carbon-cache.py start"
su $CARBON_USER -c "cd $GRAPHITE_HOME && $GRAPHITE_HOME/bin/carbon-cache.py --pidfile $PIDFILE start"
;;
stop)
echo "Stopping script carbon"
su $CARBON_USER -c "cd $GRAPHITE_HOME"; su $CARBON_USR -c "$GRAPHITE_HOME/bin/carbon-cache.py stop"
su $CARBON_USER -c "cd $GRAPHITE_HOME && $GRAPHITE_HOME/bin/carbon-cache.py --pidfile $PIDFILE stop"
;;
*)
echo "Usage: /etc/init.d/carbon {start|stop}"
Expand Down
3 changes: 3 additions & 0 deletions fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ def graphite_install():
with cd('/opt/graphite/conf/'):
sudo('cp carbon.conf.example carbon.conf')
sudo('cp storage-schemas.conf.example storage-schemas.conf')
# setting carbon pid folder and permissions
sudo('mkdir -p /var/run/carbon')
sudo('chown -R www-data: /var/run/carbon')

# starting uwsgi
sudo('supervisorctl update && supervisorctl start uwsgi')
Expand Down

0 comments on commit 409bd88

Please sign in to comment.