Skip to content

nginx "stop" and "refresh" methods should use the method script #1521

Open
@jclulow

Description

@jclulow

In the nginx service, the start method uses the shipped method script. The stop and restart methods appear to directly execute the nginx binary itself:

<exec_method type="method"
name="stop"
exec="%{config/exec} -s stop"
timeout_seconds="60" />
<exec_method type="method"
name="refresh"
exec="%{config/exec} -s reload"
timeout_seconds="60" />

I think we should consistently send it all through the method script, and be sure to pass the -c option to specify the configuration file in the other cases as well as just for start.

Another, possibly preferable, option seems like it would be to redo the refresh method as a simple :kill -HUP. The stop method could be :kill, as SIGTERM is the default signal and is essentially exactly what nginx -s stop does. (To confirm this, I inspected src/os/unix/ngx_process.c to find that -s stop translates to NGX_TERMINATE_SIGNAL which is SIGTERM for UNIX.) This is documented behaviour in nginx(8), at least, not some internal interface. This would mean we weren't dependent on the pid file to locate the process, etc.

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