Repository navigation
Keep the Kea config path on an installer re-run (GH-1747) - #1751
Merged
Merged
Conversation
A re-run of installfog.sh on a Kea install wrote the Kea JSON to the distro's ISC config path. On Ubuntu that is /etc/dhcp3/dhcpd.conf. AppArmor denies kea-dhcp4 that path, so validation fails. The install then stops before TFTP, iPXE, FTP and NFS are set up. resolveDHCPEngine() swaps the ISC package for the Kea package in $packages, and the installer saves that list. It does not save $dhcpname or $dhcpconfig, so the next run re-seeds both to the ISC values. The guard looked only for the ISC package name in the saved list. It found none, and returned before it set $dhcpconfig. The first run always worked, which is why this was missed. The guard now accepts the Kea package too. With the saved engine "kea", the re-run sets the Kea package, service and config path again. An ISC install is unchanged: its list still names the ISC package, and its saved engine is "isc". tests/dhcp-engine-rerun.test.sh replays two runs through the real function for ubuntu, redhat and arch, with each distro's own defaults read from lib/<distro>/config.sh. It also pins which keys are saved, because the re-run it replays depends on that. Before this change it failed 6 assertions: the re-run config path and package name on each distro. After it, 31 pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012JsEqysRdWb914YC94Shvo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A re-run of
installfog.shon a Kea install writes the Kea JSON to the distro's ISC config path:/etc/dhcp3/dhcpd.confon Ubuntu. AppArmor denieskea-dhcp4that path, so validation fails. The install then stops before TFTP, iPXE, FTP and NFS. The first install works. Reported in #1747.Cause
resolveDHCPEngine()swaps the ISC package for the Kea package in$packages, and the installer saves that list. It does not save$dhcpnameor$dhcpconfig, so the next run re-seeds both to the ISC values. The guard looked only for the ISC package name in the saved list. It returned before it set$dhcpconfig.Fix
The guard also accepts the Kea package. An ISC install is unchanged: its list still names the ISC package, and its saved engine is
isc.Test
tests/dhcp-engine-rerun.test.shreplays two runs through the real function for ubuntu, redhat and arch. It uses each distro's own defaults fromlib/<distro>/config.sh. It also pins which keys the installer saves, because the replayed re-run depends on that.The same fix for
working-1.6is in a separate PR.Refs #1747
🤖 Generated with Claude Code
https://claude.ai/code/session_012JsEqysRdWb914YC94Shvo