netplan icon indicating copy to clipboard operation
netplan copied to clipboard

Do not execute generator during daemon-reload (LP: #2090848)

Open slyon opened this issue 1 year ago • 6 comments

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 check successfully.
  • [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

slyon avatar Dec 02 '24 15:12 slyon

https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/2090848

daniloegea avatar Dec 02 '24 15:12 daniloegea

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.

slyon avatar Dec 03 '24 13:12 slyon

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

daniloegea avatar Dec 03 '24 17:12 daniloegea

Adding CapabilityBoundingSet+=CAP_CHOWN to NetworkManager.service might help, but would have other (security) implications.

slyon avatar Feb 19 '25 16:02 slyon

FTR: This caused an issue in Debian Trixie cloud images: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1100418

slyon avatar Mar 13 '25 20:03 slyon

See also https://github.com/canonical/netplan/pull/552

slyon avatar Jun 26 '25 11:06 slyon