From a6a226866c414368c70db7df0297316d3db39250 Mon Sep 17 00:00:00 2001 From: Valentin David Date: Mon, 14 Oct 2024 13:01:00 +0200 Subject: [PATCH] Revert "Change netplan apply to workaround LP#2058976" This reverts commit 14ece5ff92726b5274e5fee07bd8a94fee3475a0. --- Makefile | 1 - hooks/032-apply-patches.chroot | 10 ---------- patch/netplan-apply.diff | 31 ------------------------------- 3 files changed, 42 deletions(-) delete mode 100755 hooks/032-apply-patches.chroot delete mode 100644 patch/netplan-apply.diff diff --git a/Makefile b/Makefile index 8c434acc..723a8115 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,6 @@ install: /bin/cp -a static/* $(DESTDIR) mkdir -p $(DESTDIR)/install-data /bin/cp -r $(CRAFT_STAGE)/local-debs $(DESTDIR)/install-data/local-debs - /bin/cp -r patch $(DESTDIR)/install-data # customize set -eux; for f in ./hooks/[0-9]*.chroot; do \ base="$$(basename "$${f}")"; \ diff --git a/hooks/032-apply-patches.chroot b/hooks/032-apply-patches.chroot deleted file mode 100755 index c6ff6e2e..00000000 --- a/hooks/032-apply-patches.chroot +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -set -eux - -apt-get install --no-install-recommends -y patch - -# Apply netplan patch (workaround for LP#2058976 -patch -p0 -i /install-data/patch/netplan-apply.diff - -apt-get remove -y patch diff --git a/patch/netplan-apply.diff b/patch/netplan-apply.diff deleted file mode 100644 index acd11d95..00000000 --- a/patch/netplan-apply.diff +++ /dev/null @@ -1,31 +0,0 @@ ---- ./usr/share/netplan/netplan/cli/commands/apply.py 2024-04-19 10:02:42.065447958 +0100 -+++ ./usr/share/netplan/netplan/cli/commands/apply.py 2024-04-19 10:04:34.325809194 +0100 -@@ -270,15 +270,20 @@ - # exclude the special 'netplan-ovs-cleanup.service' unit - netplan_ovs = [os.path.basename(f) for f in glob.glob('/run/systemd/system/*.wants/netplan-ovs-*.service') - if not f.endswith('/' + OVS_CLEANUP_SERVICE)] -- # Run 'systemctl start' command synchronously, to avoid race conditions -+ # Run 'systemctl (re)start' command synchronously, to avoid race conditions - # with 'oneshot' systemd service units, e.g. netplan-ovs-*.service. -- try: -- utils.networkctl_reload() -- utils.networkctl_reconfigure(utils.networkd_interfaces()) -- except subprocess.CalledProcessError: -- # (re-)start systemd-networkd if it is not running, yet -- logging.warning('Falling back to a hard restart of systemd-networkd.service') -- utils.systemctl('restart', ['systemd-networkd.service'], sync=True) -+ # -+ # In the past, calls to networkctl_reload/networkctl_reconfigure -+ # were tried, but due maybe to systemd-networkd bugs, they were not -+ # working as expected: the interface was getting initially the -+ # expected state, but after some minutes it ignored the state of -+ # /run/systemd/network/ and used the configuration read when the -+ # service was started. This happened in the case of removed -+ # .network files. Looking at files in -+ # /run/systemd/netif/links/, the internal state seemed to keep -+ # removed files in NETWORK_FILE= (see LP#2058976). -+ logging.info('Restarting systemd-networkd.service') -+ utils.systemctl('restart', ['systemd-networkd.service'], sync=True) - # 1st: execute OVS cleanup, to avoid races while applying OVS config - utils.systemctl('start', [OVS_CLEANUP_SERVICE], sync=True) - # 2nd: start all other services