Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COOK-3898: apache_site definition issues a restart rather than a reload to apache #225

Closed
svanzoest opened this issue Aug 8, 2014 · 4 comments
Assignees

Comments

@svanzoest
Copy link
Contributor

Migration of https://tickets.opscode.com/browse/COOK-3898 by Kimball Johnson

From reading the source code the apache_site definition issues a restart to apache rather than a reload. This is unnecessary and will cause an short outage to your webserver which is not wanted or required.

@juliandunn comment:
I think the reason is because any custom template can be specified in the web_app definition. That template might make non-reload-safe changes (e.g. Listen port) that would cause Apache to fail entirely if just a reload were attempted.

@svanzoest svanzoest added the bug label Aug 8, 2014
@drpebcak drpebcak added this to the Jira Issues milestone Aug 9, 2014
@drpebcak
Copy link
Contributor

I think maybe this should be reworked... web_app does a :reload now, but our apache_config definition should maybe do a :restart?

@svanzoest
Copy link
Contributor Author

This is what we got currently

apache2-cookbook/definitions$ grep service *
apache_conf.rb:    notifies :reload, 'service[apache2]', :delayed
apache_config.rb:      notifies :reload, 'service[apache2]', :delayed
apache_config.rb:      notifies :reload, 'service[apache2]', :delayed
apache_mod.rb:    notifies :reload, 'service[apache2]', :delayed
apache_module.rb:        notifies :restart, 'service[apache2]', :delayed
apache_module.rb:        notifies :reload, 'service[apache2]', :delayed
apache_module.rb:        notifies :restart, 'service[apache2]', :delayed
apache_module.rb:        notifies :reload, 'service[apache2]', :delayed
apache_site.rb:      notifies :reload, 'service[apache2]', :delayed
apache_site.rb:      notifies :reload, 'service[apache2]', :delayed
web_app.rb:      notifies :reload, 'service[apache2]', :delayed

It does seem like apache_config should do a restart. More details at http://httpd.apache.org/docs/2.4/stopping.html

@rcambien
Copy link

rcambien commented Sep 20, 2016

This commit 9680088 generate the same problem than #333, the apache is restarted just after a reload and failed.

[2016-09-20T15:09:43+02:00] INFO: apt_package[newrelic-php5] sending reload action to service[apache2] (delayed)
[2016-09-20T15:09:43+02:00] INFO: Processing service[apache2] action reload (apache2::default line 206)
[2016-09-20T15:09:43+02:00] INFO: service[apache2] reloaded
[2016-09-20T15:09:43+02:00] INFO: template[/etc/apache2/conf-available/security.conf] sending restart action to service[apache2] (delayed)
[2016-09-20T15:09:43+02:00] INFO: Processing service[apache2] action restart (apache2::default line 206)
amazon-ebs:
================================================================================
Error executing action `restart` on resource 'service[apache2]'
================================================================================
amazon-ebs:
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /etc/init.d/apache2 restart ----
STDOUT: * Restarting web server apache2
...fail!
STDERR:
---- End output of /etc/init.d/apache2 restart ----
Ran /etc/init.d/apache2 restart returned 1

As mentioned in #355, the problem can be solved with a wait between the reload and the restart.

@lock
Copy link

lock bot commented Jul 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants