Skip to content

Commit

Permalink
Delay the consul reload when config file changes
Browse files Browse the repository at this point in the history
On first install, the consul service may not exist when we create the `node[:consul][:config_dir]}/default.json`. This leads to an error as the service tries to restart itself (thanks to `subscribes`) before the `/etc/init.d/consul` is created.
  • Loading branch information
jubianchi committed Jul 25, 2014
1 parent 5450f6f commit d1f2116
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion recipes/_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
service 'consul' do
supports status: true, restart: true, reload: true
action [:enable, :start]
subscribes :reload, "file[#{node[:consul][:config_dir]}/default.json]", :immediately
subscribes :reload, "file[#{node[:consul][:config_dir]}/default.json]", :delayed
end
when 'runit'
include_recipe 'runit'
Expand Down

0 comments on commit d1f2116

Please sign in to comment.