<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>We had similar discussions on this type of issue downstream in
Ubuntu [1] and after extensive discussions it was suggested that
if someone wants to use network-online.target for this they do an
override in their SystemD.</p>
<p>Given that network-online.target is not well defined, it was
determined by the Ubuntu Server Team that it made more sense to
leave it alone and let people 'customize' their configuration that
way independently.</p>
<p>Also, keep in mind NGINX Pitfalls such as those that *rely* on
DNS - you cannot guarantee that DNS is going to be reliable or
work at boot time or auto startup unless you schedule the startup
until long after networking would be configured and online. [2]<br>
</p>
<p>While I do not have direct access to control the status quo on
things for NGINX in Debian, the justification was based on this
quote from the definition of network targets [3]:</p>
<p>
<blockquote type="cite">network-online.target is a target that
actively waits until the network is "up", where the definition
of "up" is defined by the network management software. ... **It
is strongly recommended not to pull in this target too
liberally: for example network server software should generally
not pull this in (since server software generally is happy to
accept local connections even before any routable network
interface is up), its primary purpose is network client software
that cannot operate without network.**</blockquote>
</p>
<p>(emphasis with asterisks or bold is mine)</p>
<p>Given that freedesktop definitions for SystemD here say "network
server software should generally not pull this in" and NGINX is no
different (see pitfalls [2] as I said), I think the
'network.target' vs. 'network-online.target' argument should
remain as "If you want to verify it works with DNS then alter your
SystemD on a per system level, rather than having the entire
packaging system for NGINX to be rewritten for these cases given
the SystemD guidance."</p>
<p><br>
</p>
<p>Thomas</p>
<p><br>
</p>
<p>[1]: <a class="moz-txt-link-freetext" href="https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1666368">https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1666368</a></p>
<p>[2]:
<a class="moz-txt-link-freetext" href="https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#using-a-hostname-to-resolve-addresses">https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#using-a-hostname-to-resolve-addresses</a></p>
<p>[3]:
<a class="moz-txt-link-freetext" href="https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/">https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/</a><br>
</p>
<div class="moz-cite-prefix">On 11/22/21 12:45, Jeremy Ouellet
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:4177ef53-cce1-d4b7-bfce-f13fc7efbfff@jouellet.net">Package:
nginx-common
<br>
Severity: normal
<br>
<br>
Dear Maintainer,
<br>
<br>
I was messing with nginx remote proxy and found that it would
crash on startup.
<br>
I looked into the service file and it depended on network.target.
I changed it
<br>
to network-online.target so that it would work.
<br>
<br>
I beleive that nginx should wait for the network to be online
before starting
<br>
as this makes it so you can use domain names in proxy_pass. I
googled for this
<br>
issue and most people just give workarounds and I feel like the
use cases for
<br>
using just nework.target are minimal.
<br>
<br>
-- System Information:
<br>
Debian Release: 11.1
<br>
APT prefers stable-security
<br>
APT policy: (500, 'stable-security'), (500, 'stable')
<br>
Architecture: amd64 (x86_64)
<br>
Foreign Architectures: i386
<br>
<br>
Kernel: Linux 5.10.0-9-amd64 (SMP w/8 CPU threads)
<br>
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE,
<br>
TAINT_UNSIGNED_MODULE
<br>
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE not
<br>
set
<br>
Shell: /bin/sh linked to /usr/bin/dash
<br>
Init: systemd (via /run/systemd/system)
<br>
LSM: AppArmor: enabled
<br>
<br>
Versions of packages nginx-common depends on:
<br>
ii debconf [debconf-2.0] 1.5.77
<br>
ii lsb-base 11.1.0
<br>
<br>
nginx-common recommends no packages.
<br>
<br>
Versions of packages nginx-common suggests:
<br>
pn fcgiwrap <none>
<br>
<br>
<br>
</blockquote>
</body>
</html>