Skip to content

Commit

Permalink
MGMT-15339: Run network config before NetworkManager (#5375)
Browse files Browse the repository at this point in the history
Currently the systemd service that we use to apply static network
configuration from the non-minimal discovery environment wants to run
after `dracut-cmdline.service` and before `dracut-initqueue.service`.
But that isn't possible because this service is created by an ignition
configuration, and services created that way only run after the root has
pivoted, and at that point the `cmdline` and `initqueue` steps of Dracut
have already been completed.

The net result is that this ordering dependencies are just ignored, and
the service will run as part of `multi-user.target` without any special
ordering restriction. It may even run after NetworkManager. If that
happens then the configuration files that it generates will be ignored.
That is unlikely, but it has been observed when there are many network
interfaces with static configuration. To avoid that the service should
be explicitly configured to run before NetworkManager.

Note that there is another diferent systemd service that is used to
generate the network config when using the minimal ISO. That is added
directly to the initrd, not via ignition. It runs before the root pivots
because the network is needed to fetch the root file system. This patch
doesn't change that service.

Related: https://issues.redhat.com/browse/MGMT-15339
Related: https://issues.redhat.com//browse/OCPBUGS-16219
Related: openshift/installer#7355

Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
  • Loading branch information
jhernand committed Jul 28, 2023
1 parent 33855b7 commit 5ad5976
Showing 1 changed file with 3 additions and 2 deletions.
@@ -1,14 +1,15 @@
[Unit]
Description=Prepare network manager config content
Before=dracut-initqueue.service
After=dracut-cmdline.service
Before=NetworkManager.service
DefaultDependencies=no

[Service]
User=root
Type=oneshot
TimeoutSec=60
ExecStart=/bin/bash /usr/local/bin/pre-network-manager-config.sh
PrivateTmp=true
RemainAfterExit=no

[Install]
WantedBy=multi-user.target

0 comments on commit 5ad5976

Please sign in to comment.