fix: enable Furtka units inside custom_commands, not services list
Some checks failed
Build ISO / build-iso (push) Successful in 16m44s
CI / lint (push) Failing after 25s
CI / test (push) Successful in 36s
CI / validate-json (push) Successful in 22s
CI / markdown-links (push) Successful in 29s

archinstall runs `systemctl enable` over the `services` list *before*
custom_commands, so our own unit files (written in custom_commands)
didn't exist yet at enable-time and install aborted with
"Unit furtka-welcome.service does not exist". Keep `caddy` +
`avahi-daemon` in `services` since those are packaged units present
right after pacstrap; move `furtka-welcome` + `furtka-status.timer`
to a `systemctl enable` call appended to custom_commands so they fire
after the unit files land on disk.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Daniel Maksymilian Syrnicki 2026-04-14 20:34:34 +02:00
parent 8ed1d82fd3
commit 8c56c036cb
2 changed files with 17 additions and 6 deletions

View file

@ -84,10 +84,16 @@ def test_build_archinstall_config_includes_post_install_bootstrap(monkeypatch):
for pkg in ("caddy", "avahi", "nss-mdns"): for pkg in ("caddy", "avahi", "nss-mdns"):
assert pkg in cfg["packages"] assert pkg in cfg["packages"]
for svc in ("caddy", "avahi-daemon", "furtka-welcome", "furtka-status.timer"): # Packaged units go in `services` (enabled before custom_commands runs);
# our own units don't exist at that point, so they must be enabled from
# within custom_commands after the unit files land on disk.
for svc in ("caddy", "avahi-daemon"):
assert svc in cfg["services"] assert svc in cfg["services"]
assert "furtka-welcome" not in cfg["services"]
assert "furtka-status.timer" not in cfg["services"]
joined = "\n".join(cfg["custom_commands"]) joined = "\n".join(cfg["custom_commands"])
assert "systemctl enable furtka-welcome.service furtka-status.timer" in joined
for path in ( for path in (
"/etc/caddy/Caddyfile", "/etc/caddy/Caddyfile",
"/srv/furtka/www/index.html", "/srv/furtka/www/index.html",

View file

@ -449,6 +449,12 @@ def _post_install_commands(hostname):
), ),
nss_sed, nss_sed,
hostname_sed, hostname_sed,
# archinstall calls `systemctl enable` on `services` *before*
# custom_commands runs, so our own unit files aren't on disk yet at
# that point. Enable them here, after they exist. caddy /
# avahi-daemon stay in the `services` list — those are packaged
# units, present right after pacstrap.
"systemctl enable furtka-welcome.service furtka-status.timer",
] ]
@ -476,13 +482,12 @@ def build_archinstall_config(s):
"profile": {"type": "server"}, "profile": {"type": "server"},
"services": [ "services": [
"docker", "docker",
# Base OS post-install services. `furtka-welcome` refreshes # Base OS post-install services. Only packaged units go here —
# /etc/issue with the landing-page URL; `furtka-status.timer` # archinstall runs `systemctl enable` on this list *before*
# keeps /srv/furtka/www/status.json fresh for the dashboard. # custom_commands, so our own furtka-welcome + furtka-status.timer
# units (written in custom_commands) are enabled there instead.
"caddy", "caddy",
"avahi-daemon", "avahi-daemon",
"furtka-welcome",
"furtka-status.timer",
], ],
# `gpasswd -a <user> docker` has to stay first — adds the user to # `gpasswd -a <user> docker` has to stay first — adds the user to
# the docker group once the group exists (archinstall creates users # the docker group once the group exists (archinstall creates users