diff --git a/tests/test_app.py b/tests/test_app.py index 7e71df0..948ec2e 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -84,10 +84,16 @@ def test_build_archinstall_config_includes_post_install_bootstrap(monkeypatch): for pkg in ("caddy", "avahi", "nss-mdns"): 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 "furtka-welcome" not in cfg["services"] + assert "furtka-status.timer" not in cfg["services"] joined = "\n".join(cfg["custom_commands"]) + assert "systemctl enable furtka-welcome.service furtka-status.timer" in joined for path in ( "/etc/caddy/Caddyfile", "/srv/furtka/www/index.html", diff --git a/webinstaller/app.py b/webinstaller/app.py index 96345cd..d5d5e01 100644 --- a/webinstaller/app.py +++ b/webinstaller/app.py @@ -449,6 +449,12 @@ def _post_install_commands(hostname): ), nss_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"}, "services": [ "docker", - # Base OS post-install services. `furtka-welcome` refreshes - # /etc/issue with the landing-page URL; `furtka-status.timer` - # keeps /srv/furtka/www/status.json fresh for the dashboard. + # Base OS post-install services. Only packaged units go here — + # archinstall runs `systemctl enable` on this list *before* + # custom_commands, so our own furtka-welcome + furtka-status.timer + # units (written in custom_commands) are enabled there instead. "caddy", "avahi-daemon", - "furtka-welcome", - "furtka-status.timer", ], # `gpasswd -a docker` has to stay first — adds the user to # the docker group once the group exists (archinstall creates users