Opened 3 years ago
Closed 3 years ago
#1983 closed defect (duplicate)
nginx.service unit-file in rpm (CentOS 7,8)
|Reported by:||Owned by:|
|Keywords:||an unit-file nginx.service||Cc:|
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
Change History (1)
comment:1 by , 3 years ago
|Status:||new → closed|
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.