Skip to content

spored installs but does not self-terminate on TTL (systemd unit crash-loops) #19

Closed

Description

@scttfrdmn

Found during the #2 unattended-TTL observation. The bootstrap fixes (#18) work — spored installs and executes — but the instance did not self-terminate on its TTL.

Observed

Launched i-0964ad543d8ecafda: t4g.nano, us-east-1, spored-instance-profile, 5-min TTL. Polled unattended:

18:27:41 LAUNCHED  deadline=18:32:38
18:32:42 state=running (+0.1m past deadline)
...
18:36:44 state=running (+4.1m past deadline)  → backstop terminated it

Still running 4+ minutes past the TTL. Backstop cleaned up; leak-checked clean.

Diagnosis from console output

  • ✅ Bootstrap ran: Created symlink … spored.service, spored binary present at /usr/local/bin/spored, systemd started it — so arch detection, the S3 download, checksum, and install (Real-AWS bootstrap fix + launch validation (#2, #17) #18) all work.
  • ❌ The spored systemd unit crash-loops: a repeating unit=spored … res=success then res=failed cycle every ~5s (matches Restart=always RestartSec=5). The daemon isn't staying up long enough to enforce the TTL.
  • ⚠️ SELinux avc: denied on /usr/local/bin/spored — the binary carries the cloud_init_tmp_t context because the bootstrap mvs it from a /tmp mktemp file, inheriting tmp's label. It's permissive=1 (AL2023 default) so exec is allowed here, but on an enforcing host it would be blocked; the label is wrong regardless and should be restorecon'd.

Likely causes (need journald/SSM to confirm the exact spored error)

  1. spored erroring on startup (config/region/IMDS/tag-read) and exiting non-zero → restart loop. Console shows no spored app logs (it logs to journald).
  2. The SELinux mislabel (fix: restorecon -v /usr/local/bin/spored or install to the final path with the right context, not via /tmp rename).

Next step

Needs a diagnostic run with SSM Session Manager (the spored-instance-profile already has AmazonSSMManagedInstanceCore) to read journalctl -u spored and get spored's actual exit error, then fix. Blocks #2's "observe auto-terminate" acceptance. spawn-ts's install path is validated; this is a spored-runtime / bootstrap-labeling issue.

Activity

  1. added
    bug
    area: aws
    cost-safety
    on Jul 21, 2026
  2. scttfrdmn commented on Jul 21, 2026

    @scttfrdmn
    ContributorAuthor

    Fixed in #20. Root cause: the systemd unit ran spored run (unknown subcommand → non-zero exit → crash-loop). Unit now matches the Go bootstrap byte-for-byte (bare spored, Type=simple, Restart=on-failure). Validated: t4g.nano self-terminated on its 5-min TTL, unattended. The SELinux tmp-label observation was moot once the unit stopped crash-looping (AL2023 permissive; binary runs), but worth a follow-up restorecon if we ever target enforcing hosts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: awsbugcost-safety

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions