summaryrefslogtreecommitdiff
path: root/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2021-05-10 13:15:56 +0300
committerWilliam A. Kennington III <wak@google.com>2021-05-11 23:35:56 +0300
commit8fb92589e9368cff81460e89feb9da4de1f82ab8 (patch)
treecdcae3303db1341e183cec4c2a3085795442acdf /meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in
parent6ca7033951727549245d10d599890a49c2ed79f6 (diff)
downloadopenbmc-8fb92589e9368cff81460e89feb9da4de1f82ab8.tar.xz
meta-google: gbmc-bridge: Use networkctl reconfigure
The other workarounds to try and restart networkd tend to result in flaky behavior. We get much more consistent and fast reconfigurations if we target the bridge directly. Change-Id: I3222eba4a2d2b71e3893f93643f412e5238ee60e Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in')
-rw-r--r--meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in26
1 files changed, 7 insertions, 19 deletions
diff --git a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in
index f51b033d5..e033fd2a5 100644
--- a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in
+++ b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in
@@ -63,25 +63,13 @@ EOF
printf '%s' "$contents" >"$file"
done
- # We only restart networkd if we know we have a management network available
- # on the machine and networkd is already running.
- if [ -e /lib/systemd/network/-bmc-gbmcbrdummy.network ] && \
- ! systemctl status systemd-networkd | grep -q inactive; then
- echo "Restarting networkd" >&2
- # HACK: We can't restart systemd-networkd without coordinating with
- # phosphor-networkd, otherwise it will sometimes detect interfaces as
- # unmanaged because it reads administrative state to determine enabled
- # status. Adding an IP to phosphor-networkd is guaranteed to trigger the
- # restart we want, and systemd-network will never actually accept the
- # new value.
- local start=$SECONDS
- while (( SECONDS - start < 30 )); do
- busctl call xyz.openbmc_project.Network \
- /xyz/openbmc_project/network/gbmcbrdummy \
- xyz.openbmc_project.Network.IP.Create IP ssys \
- xyz.openbmc_project.Network.IP.Protocol.IPv6 ff02::1 128 '' && break
- sleep 1
- done
+ # Ensure that systemd-networkd performs a reconfiguration as it doesn't
+ # currently check the mtime of drop-in files.
+ touch -c /lib/systemd/network/*-bmc-gbmcbr.network
+
+ if [ "$(systemctl is-active systemd-networkd)" != 'inactive' ]; then
+ networkctl reload
+ networkctl reconfigure gbmcbr
fi
}