FS#55251 - [nginx] Nginx fails to restart when using listen + UNIX socket

Attached to Project: Arch Linux
Opened by Adis Nezirović (adis) - Wednesday, 23 August 2017, 15:01 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Sunday, 10 December 2017, 22:11 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Sébastien Luttringer (seblu)
Bartłomiej Piotrowski (Barthalion)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When using UNIX sockets in listen directives, Nginx fails on restarts with "[emerg] 2865#2865: bind() to unix:/run/nginx-example.net.sock failed (98: Address already in use)"

Sample config:

server {
listen unix:/run/nginx-example.net.sock;
...
}

The reason for this is using
KillSignal=SIGQUIT
in nginx systemd service file (where master process doesn't clean up its sockets)

While it would suffice to use the default SIGTERM.

Two other points:
* 'KillMode=mixed' already sends SIGTERM signal to main process and SIGKILL to other processes in the control group
* If SIGTERM fails, the termination request is repeated with SIGKILL

https://www.freedesktop.org/software/systemd/man/systemd.kill.html
This task depends upon

Closed by  Bartłomiej Piotrowski (Barthalion)
Sunday, 10 December 2017, 22:11 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in trunk.

Loading...