Do not execute generator during daemon-reload (LP: #2090848)
Description
As intended when originally implemented the netplan generator.stamp is supposed to avoid re-generating all of the Netplan configuration during 'systemd daemon-reload'.
The stamp has originally been placed in /run/systemd/generator/, which is nowadays cleaned during 'daemon-reload', leading to Netplan regenerating its configuration during each such call.
Let's move the stamp file into /run/netplan/generator.stamp instead to avoid that. Triggering the Netplan generator only at reboot, or when called explicitly.
Original intend: d2a45b3066cb20f8cfeb3e778af025ecdfbc6461
Checklist
- [x] Runs
make checksuccessfully. - [x] Retains code coverage (
make check-coverage). - [ ] New/changed keys in YAML format are documented.
- [ ] (Optional) Adds example YAML for new feature.
- [x] (Optional) Closes an open bug in Launchpad. LP#2090848
https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/2090848
As the lxd-network-manager CI shows, the NetworkManager-Netplan integration seem to rely on the re-generation of Netplan config during daemon-reload, which probably needs to be fixed first.
As the lxd-network-manager CI shows, the NetworkManager-Netplan integration seem to rely on the re-generation of Netplan config during
daemon-reload, which probably needs to be fixed first.
oohh right, that's true. Because it calls "generate" and NM capabilities are limited, it can't do things such as changing files owners... it only works because it does a daemon-reload... oofff
Adding CapabilityBoundingSet+=CAP_CHOWN to NetworkManager.service might help, but would have other (security) implications.
FTR: This caused an issue in Debian Trixie cloud images: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1100418
See also https://github.com/canonical/netplan/pull/552