On Tuesday, February 20, 2018 10:44:42 PM Martin Pitt wrote: > Steve Langasek [2018-02-16 11:12 -0800]: ... > > I think the network-online.target is the better thing to key on. > > I still don't like that much, though: > - there is no requirement that this actually gets "implemented" or even > started (it's a passive target) > > - it's supposed to be a SysV backwards compat shim for LSB's "network" > dependency, and not well-defined > > - These tools should also work with Debian containers, which in theory > could also run sysvinit. This is also the reason why they still use > `runlevel` instead of `systemctl is-system-running` or something similar. > > All of these are just heuristics, though; you could have all sorts of cases > where all of these break, like sharing the host's network namespace, having > no default route but a route to the configured apt proxy, etc. Maybe the > closest approximation to this would be to grab the archive URL from > /etc/apt/sources.list and put it in a curl loop, but (1) neither wget nor > curl are in minimal installs, and (2) at that point it could just as well > be an apt-get retry loop.
So what's the right systemd way to ensure the network is up? I continue to fight bugs in the postfix unit file both in Debian and Ubuntu over things happening before the network is up. As far as I can determine from the documentation, network-online.target should work, but I agree it doesn't do so reliably. Currently [email protected] has: After=network-online.target nss-lookup.target Wants=network-online.target If inet_interfaces has been set to a specific IP address (which is a legitimate use), then if postfix tries to start before that IP address is available errors ensue. Scott K -- ubuntu-devel mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel
