Opened 5 years ago
Closed 5 years ago
#1983 closed defect (duplicate)
nginx.service unit-file in rpm (CentOS 7,8)
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | nginx-package | Version: | 1.19.x |
Keywords: | an unit-file nginx.service | Cc: | |
uname -a: | - | ||
nginx -V: | - |
Description
Hi
In an unit-file nginx.server (from RPM packages for CentOS 7,8)
I offer to change a option ExecReload
from ExecReload=/bin/kill -s HUP $MAINPID
to ExecReload=/usr/sbin/nginx -s reload.
Because /bin/kill -s HUP $MAINPID does not have an exit code
unlike ExecReload=/usr/sbin/nginx -s reload.
As a result now, a command systemctl reload nginx.service ; echo $? does not show a correct exit code.
Thanks in advance
Alex Yakimov
Note:
See TracTickets
for help on using tickets.
The "nginx -s reload" does not have an exit code either, it's just a complex (and sometimes resource-consuming) way to find a PID file and sent the HUP signal to the running nginx process. As a side effect it checks configuration for obvious errors, but this does not guarantee that the following configuration reload in the running nginx process will be successful. Also, checking the configuration as a mandatory step before the reload is the wrong thing to do in general, see #724.
Closing this as a duplicate of #724, as suggested change is essentially the same.