-
Notifications
You must be signed in to change notification settings - Fork 225
Do not execute generator during daemon-reload (LP: #2090848) #529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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: d2a45b3
| self.assertFalse(os.path.exists(n)) | ||
| self.assertIn('netplan generate already ran', out) | ||
|
|
||
| # after removing the stamp it generates again, and not trip over the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh the test above was passing because we don't call it through a daemon-reload
|
As the lxd-network-manager CI shows, the NetworkManager-Netplan integration seem to rely on the re-generation of Netplan config during |
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 |
|
FTR: This caused an issue in Debian Trixie cloud images: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1100418 |
| * multiple times and userspace can wait for it to finish */ | ||
| _netplan_safe_mkdir_p_dir(generator_run_stamp); | ||
| FILE* f = fopen(generator_run_stamp, "w"); | ||
| g_assert(f != NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attention: This failed in Debian trixie.
| # /usr/lib/systemd/system-generators/netplan . . .
| **
| ERROR:../src/generate.c:325:main: assertion failed: (f != NULL)
| Bail out! ERROR:../src/generate.c:325:main: assertion failed: (f != NULL)
| Aborted
|
See also #552 |
|
Closed in favor of #552 |
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: d2a45b3
Checklist
make checksuccessfully.make check-coverage).