Opened 4 years ago

Closed 4 years ago

#1983 closed defect (duplicate)

nginx.service unit-file in rpm (CentOS 7,8)

Reported by: aleksandr.yakimov@… 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

Change History (1)

comment:1 by Maxim Dounin, 4 years ago

Resolution: duplicate
Status: newclosed

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.

Note: See TracTickets for help on using tickets.