fleetd #545: fix mktemp -t templates for GNU coreutils, split unclear-supervisor detail #548
Reference in New Issue
Block a user
Delete Branch "worker/545-mktemp-linux-3df50f-8"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes fleetd #545.
1. mktemp -t templates. All six
mktemp -t NAMEcalls inscripts/redeploy-fleetd.shlacked anXplaceholder. BSD mktemp (macOS) tolerates that and appends its own suffix; GNU mktemp (every Linux distribution) refuses it and exits non-zero —mktemp: too few X's in template. All six sites now use.XXXXXX.2. Split the unclear-supervisor detail.
detect_supervisor'suncleardetail used to cover two different facts with one message that always named 'systemctl exited non-zero and reported an error on stderr' — even when systemctl was never run, because the mktemp call above failed first.SYSTEMD_LOADED_ERRORED/SYSTEMD_INSTALLED_ERROREDnow carry a third value (2 = the probe's own mktemp setup failed) alongside the existing 1 (systemctl ran and answered badly on stderr), anddetect_supervisorgives each its own detail text.kindstaysunclearin both cases;require_drivable_supervisoris unchanged.Tests added to
scripts/test-redeploy-fleetd.sh:test_mktemp_dash_t_templates_have_x_placeholders: source-text check, fails if anymktemp -ttemplate lacks an X.test_detect_supervisor_systemd_probe_setup_failure_is_unclear: proves the SET-UP-FAILED detail fires when mktemp itself fails (systemctl never runs).test_detect_supervisor_systemd_probe_error_is_unclear: extended with assertions that the PROBE-ANSWERED-WITH-STDERR detail is present and the SET-UP-FAILED wording is absent, so swapping the two messages fails a test in both directions.Verification (shell only, no Java changes):
bash scripts/test-redeploy-fleetd.sh: exit 0, anchoredgrep -c '^FAIL:'= 0 (unanchored count = 3, the suite's own pre-existing internal mutation-cell fixture lines).bash -nclean on both scripts under/bin/bash3.2.57(1)-release andenv bash5.3.9(1)-release.comm -3(was 65/65 before this change).shasum -a 256matched the pre-mutation hash, then ran a green control (exit 0, 0 anchored FAILs).scripts/redeploy-fleetd.shitself was never executed, with any flag — verification isbash -nplus the sourced test suite only.Out of scope, reported not fixed: searched the whole repo for other
mktempuses outside these two files; found onlyscripts/test-probe-member-credentials.sh:8, which already usesmktemp -d ... .XXXXXXand is not affected.