Created
October 28, 2014 21:26
-
-
Save obazoud/1d3baa805a2d3d8ab8ae to your computer and use it in GitHub Desktop.
Restart carbon-cache if configuration changed
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
diff --git a/providers/service_runit.rb b/providers/service_runit.rb | |
index 5352726..1437a10 100644 | |
--- a/providers/service_runit.rb | |
+++ b/providers/service_runit.rb | |
@@ -31,6 +31,10 @@ action :disable do | |
set_updated { manage_runit_service(:disable) } | |
end | |
+action :restart do | |
+ set_updated { manage_runit_service(:restart) } | |
+end | |
+ | |
def manage_runit_service(resource_action) | |
runit_service(new_resource.service_name) do | |
cookbook "graphite" | |
diff --git a/recipes/_carbon_config.rb b/recipes/_carbon_config.rb | |
index 0feb4b0..4383fe3 100644 | |
--- a/recipes/_carbon_config.rb | |
+++ b/recipes/_carbon_config.rb | |
@@ -35,4 +35,6 @@ file "storage-schemas.conf" do | |
action :nothing | |
end | |
-graphite_storage_conf_accumulator "default" | |
+graphite_storage_conf_accumulator "default" do | |
+ notifies :restart, "graphite_service[cache]" | |
+end | |
diff --git a/resources/service.rb b/resources/service.rb | |
index 29b0a86..1ff28cd 100644 | |
--- a/resources/service.rb | |
+++ b/resources/service.rb | |
@@ -17,7 +17,7 @@ | |
# limitations under the License. | |
# | |
-actions :enable, :disable | |
+actions :enable, :disable, :restart | |
default_action :enable | |
attribute :name, :kind_of => String, :default => nil, :name_attribute => true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment