Skip to content

Commit

Permalink
Merge branch 'systemd-daemon-reload-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
mthssdrbrg committed Aug 24, 2016
2 parents 492dff8 + 6b5fe3d commit 644184b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
8 changes: 8 additions & 0 deletions recipes/_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,17 @@
helper :controlled_shutdown_enabled? do
!!fetch_broker_attribute(:controlled, :shutdown, :enable)
end
if kafka_init_style == :systemd
notifies :run, 'execute[kafka systemctl daemon-reload]', :immediately
end
if restart_on_configuration_change?
notifies :create, 'ruby_block[coordinate-kafka-start]', :immediately
end
end

execute 'kafka systemctl daemon-reload' do
command 'systemctl daemon-reload'
action :nothing
end if kafka_init_style == :systemd

include_recipe node['kafka']['start_coordination']['recipe']
5 changes: 5 additions & 0 deletions spec/recipes/configure_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@
'systemd/default.erb'
end

it 'reloads unit files' do
expect(chef_run.execute('kafka systemctl daemon-reload')).to do_nothing
expect(chef_run.template(init_path)).to notify('execute[kafka systemctl daemon-reload]').to(:run).immediately
end

context 'and platform is \'debian\'' do
it_behaves_like 'an init style' do
let :platform_and_version do
Expand Down
4 changes: 0 additions & 4 deletions test/integration/systemd/serverspec/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
'systemctl status kafka.service'
end

before :all do
run_command 'systemctl daemon-reload'
end

before do
run_command 'systemctl reset-failed kafka.service'
end
Expand Down
1 change: 1 addition & 0 deletions vagrantfiles/cachier.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Vagrant.configure('2') do |c|
c.ssh.insert_key = false
if Vagrant.has_plugin?('vagrant-cachier')
c.cache.auto_detect = true
c.cache.scope = :box
Expand Down

0 comments on commit 644184b

Please sign in to comment.