From fcf93b88d53da4cd6e4a865c58334cb9b6435637 Mon Sep 17 00:00:00 2001 From: Patrick Wyatt Date: Mon, 18 Aug 2014 17:34:14 -0700 Subject: [PATCH] Fix runit initialization on new server Move "include_recipe 'runit'" to happen before creating default.json since runit subscribes *immediately* to changes to that file. This fixes first Chef run on a new system. --- recipes/_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/_service.rb b/recipes/_service.rb index bc933646..4a181a8d 100644 --- a/recipes/_service.rb +++ b/recipes/_service.rb @@ -25,6 +25,8 @@ # Select service user & group case node[:consul][:init_style] when 'runit' + include_recipe 'runit' + consul_user = node[:consul][:service_user] consul_group = node[:consul][:service_group] consul_directories << '/var/log/consul' @@ -116,8 +118,6 @@ subscribes :restart, "file[#{node[:consul][:config_dir]}/default.json]", :delayed end when 'runit' - include_recipe 'runit' - runit_service 'consul' do supports status: true, restart: true, reload: true action [:enable, :start]