Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#53250 - [nginx] systemctl reload nginx exit with success status with broken config

Attached to Project: Arch Linux
Opened by Alexandr (disarmer) - Saturday, 11 March 2017, 10:52 GMT
Last edited by Sébastien Luttringer (seblu) - Sunday, 26 March 2017, 22:25 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Sébastien Luttringer (seblu)
Bartłomiej Piotrowski (Barthalion)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: systemctl reload nginx exit normally even if there are errors in config file

Steps to reproduce:
- start nginx with any working config
- break config somehow
- issue systemctl reload nginx. It's return 0 exit code, but actually nginx was not reloaded (you can see errors in journalctl)

See https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecReload= :
"It is strongly recommended to set ExecReload= to a command that not only triggers a configuration reload of the daemon, but also synchronously waits for it to complete."

As a workaround we can add two actions for reload in /usr/lib/systemd/system/nginx.service:
ExecReload=/usr/sbin/nginx -t
ExecReload=/bin/kill -s HUP $MAINPID
This task depends upon

Closed by  Sébastien Luttringer (seblu)
Sunday, 26 March 2017, 22:25 GMT
Reason for closing:  Fixed
Additional comments about closing:  nginx-1.10.3-4
Comment by Alexandr (disarmer) - Saturday, 11 March 2017, 16:42 GMT
One more way, probably better:
ExecReload=/usr/sbin/nginx -s reload

Loading...