Repository navigation
fix(packer/aws): AMI cleanup check fails a correct image (#3004) - #3182
Merged
Merged
Conversation
90-aws-cleanup.sh stopped every build from the v1.0.0-aws.1 tag: - `sshd -T` exits 255 with "Missing privilege separation directory: /run/sshd" on Ubuntu 24.04, where ssh is socket-activated. Create the directory first (tmpfs, not baked into the image). - `sshd -T | grep -q` under pipefail fails even when the setting is right: grep exits on the match and sshd dies of SIGPIPE. Capture the output, then grep it. - `find -prune ... -delete` exits 1 on GNU find (-delete implies -depth, which disables -prune), so set -e aborted the log cleanup. Delete via -print0 | xargs rm. A build from the tag with this script produced an AMI with all cleanup checks passing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
vybe
approved these changes
Oct 2, 2026
vybe
left a comment
Contributor
There was a problem hiding this comment.
merge-train: validated READY (lane B, sole survivor of today's queue — merged individually, no train assembled). Traced all three fixes: the captured sshd -T avoids the pipefail/SIGPIPE false-fail and a non-zero exit in a || list doesn't trip set -e; -print0 | xargs -0r rm -f keeps the journal prune and removes GNU find's -delete/-prune exit 1. tests/unit/test_3004_aws_packer.py 14/14 on the head. Coverage note: those tests are source-text only; behaviour is evidenced by the real packer build in the PR body, which is the only harness this build-time script has.
vybe
pushed a commit
that referenced
this pull request
Oct 5, 2026
Pre-release for the AWS Marketplace AMI (#3004). Supersedes 1.0.0-aws.1 and carries the AMI cleanup fix (#3182) and the CPU cap at the host's count (#3184), without which the system agent never starts on a 2-vCPU instance. The DigitalOcean installer default moves with VERSION (trinity#2380). Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #3004.
packer/aws/scripts/90-aws-cleanup.shfailed every AMI build fromv1.0.0-aws.1. Three defects, each found on a real build in us-east-1:sshd -Texits 255 (Missing privilege separation directory: /run/sshd) on Ubuntu 24.04, where ssh is socket-activated. The check read that as "password auth enabled". Fix:install -d /run/sshdfirst (tmpfs, not baked).sshd -T | grep -qunderset -o pipefailfails even when the setting is right: grep exits on the match, sshd gets SIGPIPE. Fix: capture into a variable, then grep. A failingsshd -Tnow reports its own error line.find /var/log -path /var/log/journal -prune -o ... -deleteexits 1 on GNU find (-deleteimplies-depth, which disables-prune), soset -eaborted the script. Fix:-print0 | xargs -0r rm -f.Verification
/run/sshdcreated,sshd -Trc=0 and printspasswordauthentication no; the old pipe form still failed.yes, fail with the sshd error on rc=255. Old pipe form fails on the correct config.findforms run inubuntu:24.04: old form exits 1; new form deletes*.gz/*.[0-9]outside the journal and leaves journal files untouched.packer build -var image_tag=v1.0.0-aws.1with this script:=== AMI cleanup checks passed ===, AMI created.The script is a build-time step only; nothing it changes reaches a running instance's behaviour beyond what the tag already intended.
🤖 Generated with Claude Code