Skip to content

Commit

Permalink
35coreos-live: stop overriding NetworkManager-wait-online timeout to 5s
Browse files Browse the repository at this point in the history
We originally did this in #326 because we wanted to support booting the
live ISO without networking. This was solved on the initramfs side by
the conditional networking work (#426). But for the real root, this was
still useful because if booting the ISO interactively on a system
without any network, or a non-DHCP network, we didn't want the user to
have to wait until the service timed out before getting a shell.

The core issue however is that we're requesting `network-online.target`
at all. It's an "active unit" which means that it's only pulled in the
transaction, possibly delaying boot, if another systemd unit needs it.
And ideally, no service would need it as per:

https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/

In our case, this unit was fedora-coreos-pinger. We drop that
requirement here:

coreos/fedora-coreos-pinger#41

With that, we no longer pull in `network-online.target` and so no longer
delay reaching the console even if NetworkManager isn't able to get an
active connection for whatever reason. This matches how it works on
traditional Fedora as well.

Having a short timeout actually also had a counterproductive effect in
the automated install case. There, `coreos-installer.service` does pull
in `network-online.target` (which with
coreos/coreos-installer#565 we could consider
dropping as advised by systemd, though we probably should bump the
number of retries some more in that case), but because of the short
timeout, we genuinely may not yet have the network fully up before we
run (see https://bugzilla.redhat.com/show_bug.cgi?id=1967483).

(cherry picked from commit dd54e8c)
  • Loading branch information
jlebon committed Jul 19, 2021
1 parent 43eb876 commit 5b8fff7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 28 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ add_requires sysroot.mount initrd-root-fs.target
add_requires sysroot-etc.mount initrd-root-fs.target
add_requires sysroot-var.mount initrd-root-fs.target

add_requires coreos-liveiso-reconfigure-nm-wait-online.service initrd.target

mkdir -p "${UNIT_DIR}/ostree-prepare-root.service.d"
cat > "${UNIT_DIR}/ostree-prepare-root.service.d/10-live.conf" <<EOF
# With live PXE there's no ostree= argument on the kernel command line, so
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,4 @@ install() {

install_and_enable_unit "coreos-livepxe-persist-osmet.service" \
"default.target"

inst_simple "$moddir/coreos-liveiso-reconfigure-nm-wait-online.service" \
"$systemdsystemunitdir/coreos-liveiso-reconfigure-nm-wait-online.service"
}
8 changes: 8 additions & 0 deletions tests/kola/misc-ro
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,11 @@ case "$stream" in
fi
;;
esac

# We shouldn't pull this into the transaction by default. See
# https://github.com/coreos/fedora-coreos-config/pull/1088
# https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
if ! systemctl show -p ActiveState network-online.target | grep -q ActiveState=inactive; then
fatal "Unit network-online.target shouldn't be active"
fi
ok "unit network-online.target inactive"

0 comments on commit 5b8fff7

Please sign in to comment.