Skip to content

Commit

Permalink
[COOK-4469] - Use reload instead of restart on RHEL
Browse files Browse the repository at this point in the history
Signed-off-by: Sean OMeara <[email protected]>
  • Loading branch information
StevenBarre authored and Sean OMeara committed Mar 28, 2014
1 parent 45f08b4 commit a783952
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion definitions/apache_conf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
template "#{node['apache']['dir']}/mods-available/#{params[:name]}.conf" do
source "mods/#{params[:name]}.conf.erb"
mode '0644'
notifies :restart, 'service[apache2]'
notifies :reload, 'service[apache2]'
end
end
4 changes: 2 additions & 2 deletions definitions/apache_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
if params[:enable]
execute "a2enmod #{params[:name]}" do
command "/usr/sbin/a2enmod #{params[:name]}"
notifies :restart, 'service[apache2]'
notifies :reload, 'service[apache2]'
not_if do
::File.symlink?("#{node['apache']['dir']}/mods-enabled/#{params[:name]}.load") &&
(::File.exists?("#{node['apache']['dir']}/mods-available/#{params[:name]}.conf") ? ::File.symlink?("#{node['apache']['dir']}/mods-enabled/#{params[:name]}.conf") : true)
Expand All @@ -45,7 +45,7 @@
else
execute "a2dismod #{params[:name]}" do
command "/usr/sbin/a2dismod #{params[:name]}"
notifies :restart, 'service[apache2]'
notifies :reload, 'service[apache2]'
only_if { ::File.symlink?("#{node['apache']['dir']}/mods-enabled/#{params[:name]}.load") }
end
end
Expand Down
4 changes: 2 additions & 2 deletions definitions/apache_site.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
if params[:enable]
execute "a2ensite #{params[:name]}" do
command "/usr/sbin/a2ensite #{params[:name]}"
notifies :restart, 'service[apache2]'
notifies :reload, 'service[apache2]'
not_if do
::File.symlink?("#{node['apache']['dir']}/sites-enabled/#{params[:name]}") ||
::File.symlink?("#{node['apache']['dir']}/sites-enabled/000-#{params[:name]}")
Expand All @@ -33,7 +33,7 @@
else
execute "a2dissite #{params[:name]}" do
command "/usr/sbin/a2dissite #{params[:name]}"
notifies :restart, 'service[apache2]'
notifies :reload, 'service[apache2]'
only_if do
::File.symlink?("#{node['apache']['dir']}/sites-enabled/#{params[:name]}") ||
::File.symlink?("#{node['apache']['dir']}/sites-enabled/000-#{params[:name]}")
Expand Down
10 changes: 5 additions & 5 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
owner 'root'
group node['apache']['root_group']
mode '0644'
notifies :restart, 'service[apache2]'
notifies :reload, 'service[apache2]'
end

template 'apache2-conf-security' do
Expand All @@ -169,7 +169,7 @@
group node['apache']['root_group']
mode '0644'
backup false
notifies :restart, 'service[apache2]'
notifies :reload, 'service[apache2]'
end

template 'apache2-conf-charset' do
Expand All @@ -179,23 +179,23 @@
group node['apache']['root_group']
mode '0644'
backup false
notifies :restart, 'service[apache2]'
notifies :reload, 'service[apache2]'
end

template "#{node['apache']['dir']}/ports.conf" do
source 'ports.conf.erb'
owner 'root'
group node['apache']['root_group']
mode '0644'
notifies :restart, 'service[apache2]'
notifies :reload, 'service[apache2]'
end

template "#{node['apache']['dir']}/sites-available/default" do
source 'default-site.erb'
owner 'root'
group node['apache']['root_group']
mode '0644'
notifies :restart, 'service[apache2]'
notifies :reload, 'service[apache2]'
end

node['apache']['default_modules'].each do |mod|
Expand Down

0 comments on commit a783952

Please sign in to comment.