Description
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:
omnios-extra/build/nginx/files/http-nginx-template.xml
Lines 76 to 84 in 4e1b852
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.