Skip to content

Keep the Kea config path on an installer re-run (GH-1747) - #1751

Merged
mastacontrola merged 1 commit into
dev-branchfrom
fix/1747-kea-rerun-dev
Sep 10, 2026
Merged

mastacontrola merged 1 commit into
dev-branchfrom
fix/1747-kea-rerun-dev

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Problem

A re-run of installfog.sh on a Kea install writes the Kea JSON to the distro's ISC config path: /etc/dhcp3/dhcpd.conf on Ubuntu. AppArmor denies kea-dhcp4 that 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 $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 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.sh replays two runs through the real function for ubuntu, redhat and arch. It uses each distro's own defaults from lib/<distro>/config.sh. It also pins which keys the installer saves, because the replayed re-run depends on that.

  • Before the fix: 25 passed, 6 failed. The failures are the re-run config path and package name on each distro.
  • After the fix: 31 passed, 0 failed.

The same fix for working-1.6 is in a separate PR.

Refs #1747

🤖 Generated with Claude Code

https://claude.ai/code/session_012JsEqysRdWb914YC94Shvo

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
@mastacontrola
mastacontrola merged commit e677e23 into dev-branch Sep 10, 2026
8 checks passed
@mastacontrola
mastacontrola deleted the fix/1747-kea-rerun-dev branch September 10, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant