Skip to content

Fix spored systemd unit → self-terminates on TTL (closes #2, #19) - #20

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/spored-systemd-unit
Jul 21, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/spored-systemd-unit

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

The sole reason the prior live run didn't self-terminate: the systemd unit ran ExecStart=/usr/local/bin/spored run, but the spored daemon is the bare spored invocation — run isn't a subcommand, so spored exited non-zero and the unit crash-looped (Restart), never enforcing the TTL.

Fix

Made the instance side byte-for-byte identical to the Go bootstrap's unit (pkg/launcher/bootstrap.go) — no reinvention:
Type=simple · Environment=SPORE_DNS_SIGV4=1 · ExecStart=/usr/local/bin/spored · Restart=on-failure · RestartSec=10 · TimeoutStopSec=30 · journal output · NoNewPrivileges; enable + start.

(We still use the actual spored binary, downloaded the same way Go's launcher resolves it — the only intentional divergence remains the browser-side download source, already matched to Go's S3 scheme.)

Validated on real AWS

t4g.nano, us-east-1, spored-instance-profile, 5-min TTL → stayed running to the deadline, then spored self-terminated it ~35s later, unattended:

18:52:27 state=running (+0.1m past deadline)
18:52:57 state=shutting-down  ✅ spored SELF-TERMINATED on TTL

Confirmed terminated, no leaked instances/volumes. The self-termination guarantee — the whole point of spawn — now holds on real AWS end-to-end, not just substrate.

194 tests, typecheck + build green. Closes #2 and #19.

…closes #2)

The unit ran `ExecStart=/usr/local/bin/spored run`, but the daemon is the BARE
`spored` invocation — `run` is not a subcommand, so spored exited non-zero and
the unit crash-looped (Restart), never enforcing the TTL. This was the sole
reason the prior live run didn't self-terminate.

Made the instance side byte-for-byte the Go bootstrap's unit (no reinvention):
Type=simple, Environment=SPORE_DNS_SIGV4=1, ExecStart=/usr/local/bin/spored,
Restart=on-failure, RestartSec=10, TimeoutStopSec=30, journal output,
NoNewPrivileges; enable + start (not enable --now).

Validated on real AWS: t4g.nano, 5-min TTL, us-east-1, spored-instance-profile →
stayed running to the deadline, then spored self-terminated it ~35s later,
unattended. Leak-checked clean. The self-termination guarantee now holds on real
AWS end-to-end. 194 tests.
@scttfrdmn
scttfrdmn merged commit f1c9b42 into main Jul 21, 2026
1 check passed
@scttfrdmn
scttfrdmn deleted the fix/spored-systemd-unit branch July 21, 2026 18:56
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.

Validate real-AWS launch end-to-end (spored self-termination)

1 participant