Skip to content

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

@3flex

Description

@3flex

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions