Permalink
Browse files

graphite: runit twistd support

  • Loading branch information...
fujin committed Oct 8, 2012
1 parent aaeb334 commit 12e49e6d51ae75f9679dd189704dff6bed2bb684
View
@@ -13,6 +13,7 @@
default['graphite']['carbon']['line_receiver_interface'] = "127.0.0.1"
default['graphite']['carbon']['pickle_receiver_interface'] = "127.0.0.1"
default['graphite']['carbon']['cache_query_interface'] = "127.0.0.1"
+default['graphite']['carbon']['service_type'] = "runit"
default['graphite']['password'] = "change_me"
default['graphite']['url'] = "graphite"
View
@@ -9,6 +9,9 @@
depends "python"
depends "apache2"
-depends "runit"
+
+suggests "runit"
+suggests "systemd"
+suggests "s6"
suggests "graphiti"
View
@@ -48,6 +48,5 @@
group node['apache']['group']
end
-runit_service "carbon-cache" do
- finish_script true
-end
+service_type = node['graphite']['carbon']['service_type']
+include_recipe "#{cookbook_name}::#{recipe_name}_#{service_type}"
View
@@ -0,0 +1,3 @@
+runit_service "carbon-cache" do
+ finish_script true
+end
@@ -0,0 +1 @@
+runit_service "twistd-carbon-cache"
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec svlogd -tt ./main
@@ -0,0 +1,3 @@
+#!/bin/sh
+exec 2>&1
+exec chpst -u <%= node['apache']['user'] %>:<%= node['apache']['group'] %> -l <%= node['graphite']['base_dir'] %>/storage/carbon-cache.lock -- bash -c twistd --nodaemon --umask=0022 carbon-cache -c <%= node['graphite']['base_dir']%>/conf/carbon.conf --instance=a start
View
@@ -1,11 +1,17 @@
# -*- mode: ruby -*-
-
platform :centos do
end
-platform :redhat do
+platform :ubuntu do
+ version "12.04" do
+ box "opscode-ubuntu-12.04"
+ box_url "https://opscode-vm.s3.amazonaws.com/vagrant/boxes/opscode-ubuntu-12.04.box"
+ end
end
cookbook "graphite" do
+ configuration "carbon"
+ configuration "carbon_runit"
+ configuration "carbon_runit_twistd"
runtimes []
end
@@ -0,0 +1 @@
+node.override['graphite']['carbon']['service_type'] = "runit"
@@ -0,0 +1 @@
+node.override['graphite']['carbon']['service_type'] = "runit_twistd"

0 comments on commit 12e49e6

Please sign in to comment.