FS#64587 - [nginx][nginx-mainline]: update service file with Wants=network-online.target
Attached to Project:
Arch Linux
Opened by Tim (bastelfreak) - Wednesday, 20 November 2019, 11:24 GMT
Last edited by Massimiliano Torromeo (mtorromeo) - Saturday, 16 September 2023, 09:23 GMT
Opened by Tim (bastelfreak) - Wednesday, 20 November 2019, 11:24 GMT
Last edited by Massimiliano Torromeo (mtorromeo) - Saturday, 16 September 2023, 09:23 GMT
|
Details
Description:
Hi, I've nginx and also nginx-mainline deployed on a few hundred boxes. They are supposed to bind to specific ip addresses. Sometimes during a reboot this fails because the ip address isn't available yet. I checked the systemd documentation at https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/#cutthecraphowdoimakesurethatmyservicestartsafterthenetworkisreallyonline. They recommend the following change: $ git diff diff --git a/repos/community-x86_64/service b/repos/community-x86_64/service index 365bc95..ef00027 100644 --- a/repos/community-x86_64/service +++ b/repos/community-x86_64/service @@ -1,6 +1,7 @@ [Unit] Description=A high performance web server and a reverse proxy server -After=network.target network-online.target nss-lookup.target +After=network-online.target nss-lookup.target +Wants=network-online.target [Service] Type=forking Additional info: * package version(s) 1.17.4-1 nginx-mainline and also 1.16.1-1 nginx * config and/or log files etc. nginx[803]: 2019/07/01 11:04:26 [emerg] 803#803: bind() to *myip*:9100 failed (99: Cannot assign requested address) * link to upstream bug report, if any Steps to reproduce: reboot a server with nginx very often |
This task depends upon
Closed by Massimiliano Torromeo (mtorromeo)
Saturday, 16 September 2023, 09:23 GMT
Reason for closing: Implemented
Additional comments about closing: nginx-1.24.0-2
Saturday, 16 September 2023, 09:23 GMT
Reason for closing: Implemented
Additional comments about closing: nginx-1.24.0-2
Does "Want"ing network-online.target really enforce something like systemd-networkd? As far as I understand, network-online.target only depends on network.target and other services (for example systemd-networkd-wait-online.service) MAY add themselves "Before" the target.