Skip to content

Commit

Permalink
fix(cms): reload NetworkManager connections
Browse files Browse the repository at this point in the history
When NetworkManager is running as systemd service, it's not enough to write
connection files; the module should also tell NetworkManager to reload the
connections from disk so that any new connection can be auto-activated.

https://bugzilla.redhat.com/show_bug.cgi?id=1975929
  • Loading branch information
bengal authored and johannbg committed Aug 9, 2021
1 parent 5ee7e24 commit 07977ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules.d/35network-manager/nm-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ nm_generate_connections() {
done
fi
}

nm_reload_connections() {
[ -n "$DRACUT_SYSTEMD" ] && systemctl is-active nm-initrd.service && nmcli connection reload
}
1 change: 1 addition & 0 deletions modules.d/80cms/cmsifup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ echo "$IFACES" >> /tmp/net.ifaces
if [ -x /usr/libexec/nm-initrd-generator ] || [ -x /usr/lib/nm-initrd-generator ]; then
type nm_generate_connections > /dev/null 2>&1 || . /lib/nm-lib.sh
nm_generate_connections
nm_reload_connections
else
exec ifup "$DEVICE"
fi

0 comments on commit 07977ee

Please sign in to comment.