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

Change $service_restart custom command to use "nginx -t" by default #182

Closed
3flex opened this issue Nov 15, 2013 · 0 comments
Closed

Change $service_restart custom command to use "nginx -t" by default #182

3flex opened this issue Nov 15, 2013 · 0 comments

Comments

@3flex
Copy link
Contributor

3flex commented Nov 15, 2013

The current service_restart command to do a test of the configuration before restarting nginx is tied too much to the init system in use and is apparently causing some issues/confusion (#181, #150).

nginx has had the -t switch since at least 0.3.3 released in October 2005. Consider changing

$nx_service_restart = '/etc/init.d/nginx configtest && /etc/init.d/nginx restart'

to

$nx_service_restart = 'nginx -t && /etc/init.d/nginx restart'

Or, use a custom exec to run nginx -t which the service type will subscribe to. This will likely be cleaner as the restart command won't override the appropriate one for the init system in use.

I'm happy to work on this, but need to know the fully qualified paths for the nginx binary on each OS and what the preferred approach would be.

If we identify this for only a selection of OSs then I'll define the command for those and use /etc/init.d/nginx configtest as the default so at least it improves things on the OSs we know about.

@3flex 3flex closed this as completed Jun 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant