From d1f21164d03f2cf74b995e61219565821189b5f3 Mon Sep 17 00:00:00 2001 From: Julien BIANCHI Date: Fri, 25 Jul 2014 19:57:55 +0200 Subject: [PATCH] Delay the consul reload when config file changes 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. --- recipes/_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/_service.rb b/recipes/_service.rb index ecb90fae..d169b6de 100644 --- a/recipes/_service.rb +++ b/recipes/_service.rb @@ -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'