Commit 3ed87a0f authored by David Johnson's avatar David Johnson

Control yet another systemd/udev race/dependency on Ubuntu 16.

The stock Ubuntu 16 networking.service only runs `udevadm settle` if
there are 'auto ...' stanzas in /etc/network/interfaces .  Well, we got
rid of that a few commits ago, and now let udev rules populate
/etc/network/interfaces (really /run/emulab-interfaces.d-auto-added/*).
So, it's either hack the networking.service unit file to force udev to
settle, and have it blown away on package update; or add a
networking-emulab.service that has to run before networking.service to
force udev to settle.  We *always* want udev to settle on any Emulab
node before bringing up interfaces, just in case the control net NIC is
slow for whatever reason.
parent b6abcfd2
......@@ -74,6 +74,7 @@ dir-install:
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/systemd
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/systemd/system
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/systemd/system/network-online.target.wants
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/systemd/system/networking.service.wants
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/systemd/system/multi-user.target.wants
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/udev
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/udev/rules.d
......@@ -127,6 +128,12 @@ systemd-install: dir-install
rm -f $(SYSETCDIR)/systemd/system/network-online.target.wants/ifup-wait-all-auto.service
ln -sf ../ifup-wait-emulab-cnet.service \
$(SYSETCDIR)/systemd/system/network-online.target.wants/ifup-wait-emulab-cnet.service
$(INSTALL) -m 644 $(SRCDIR)/networking-emulab.service \
$(SYSETCDIR)/systemd/system/networking-emulab.service
ln -sf ../networking-emulab.service \
$(SYSETCDIR)/systemd/system/networking.service.wants/networking-emulab.service
ln -sf ../networking-emulab.service \
$(SYSETCDIR)/systemd/system/network-online.target.wants/networking-emulab.service
$(INSTALL) -m 644 $(SRCDIR)/ntp.service $(SYSETCDIR)/systemd/system
ln -sf $(SYSETCDIR)/systemd/system/ntp.service \
$(SYSETCDIR)/systemd/system/multi-user.target.wants/ntp.service
......
[Unit]
Description=Force udev to settle before Raise network interfaces
Documentation=man:interfaces(5)
DefaultDependencies=no
Wants=network.target
After=local-fs.target network-pre.target apparmor.service systemd-sysctl.service systemd-modules-load.service
Before=network.target networking.service
Conflicts=networking.target
[Install]
WantedBy=networking.service
WantedBy=network-online.target
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'udevadm settle'
ExecStop=
RemainAfterExit=false
TimeoutStartSec=2min
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment