Browse Source

Override NetworkManager to wait for udev-settle

As described inline, we think that NetworkManager is starting before
glean because the udev events have not been processed and the glean
services have not started.  Since there is nothing blocking it, the
network-pre.target is reached and systemd is free to start
NetworkManager.

Although it is not reccommended to wait on udev-settle because it
could result in long timeouts [1], I don't think we have a choice here
because the fundamental nature of this tool is to override settings
before NetworkManager goes off and does its own thing.

[1] https://www.freedesktop.org/software/systemd/man/systemd-udev-settle.service.html

Co-Authored-By: Dmitry Tantsur <dtantsur@protonmail.com>
Change-Id: I1c9c68d3eb5fbeb42901f2ed95860641cb2d676f
changes/80/781580/2
Ian Wienand 2 months ago
committed by Dmitry Tantsur
parent
commit
169bed877e
2 changed files with 20 additions and 0 deletions
  1. +3
    -0
      glean/init/nm-udev-settle.override
  2. +17
    -0
      glean/install.py

+ 3
- 0
glean/init/nm-udev-settle.override View File

@ -0,0 +1,3 @@
[Unit]
After=systemd-udev-settle.service
Wants=systemd-udev-settle.service

+ 17
- 0
glean/install.py View File

@ -142,6 +142,23 @@ def main():
install('nm-no-resolv-handling.conf',
'/etc/NetworkManager/conf.d/nm-no-resolv-handling.conf',
mode='0644')
# NetworkManager has a "after" network-pre, and
# glean@<interface> services have a "before". However, if
# udev has not yet triggered and started the glean
# service, which it seems can be quite common in a slow
# environment like a binary-translated nested-vm, systemd
# may think it is fine to start NetworkManager because
# network-pre has been reached with no blockers. Thus we
# override NetworkManager to wait for udev-settle, which
# should ensure the glean service has started; which will
# block network-pre until it finishes writing out the
# configs.
install(
'nm-udev-settle.override',
'/etc/systemd/system/NetworkManager.service.d/override.conf',
mode='0644')
elif os.path.exists('/etc/init'):
log.info("Installing upstart services")
install('glean.conf', '/etc/init/glean.conf')


Loading…
Cancel
Save