summaryrefslogtreecommitdiff
path: root/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in
diff options
context:
space:
mode:
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 f51b033d54..e033fd2a5a 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
}