Skip to content

Commit

Permalink
Fix runit initialization on new server
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
webcoyote committed Aug 19, 2014
1 parent 399a722 commit fcf93b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions recipes/_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit fcf93b8

Please sign in to comment.