Skip to content

SLOP-343/SLOP-344: entrypoints abort every default container start (unset WAIT_TARGET / SLEEP) - #1

Open
tosfos wants to merge 2 commits into
masterfrom
SLOP-343-entrypoint-wait-defaults
Open

tosfos wants to merge 2 commits into
masterfrom
SLOP-343-entrypoint-wait-defaults

Conversation

@tosfos

@tosfos tosfos commented Aug 22, 2026

Copy link
Copy Markdown

Found during the org-wide audit of WikiTeq/docker-varnish.

SLOP-343 — fresh/alpine image cannot start by default

fresh/alpine/scripts/docker-varnish-entrypoint.sh ran wait-for-it.sh -t $WAIT_TIMEOUT "$WAIT_TARGET" unconditionally with both variables unset (no ENV, no defaults, no documentation). Under set -e, wait-for-it.sh prints a usage error and exits 1, so the container dies before varnishd launches.

Verified empirically (alpine:3.15 + this repo's wait-for-it.sh; exit codes via docker inspect):

  • default deploy (no env): container exits 1, varnishd never starts
  • WAIT_TARGET set + reachable: works
  • WAIT_TARGET set + unreachable: busybox timeout SIGTERMs the probe loop, container exits 143

Fix: skip the wait when WAIT_TARGET is empty (restores upstream behavior), default WAIT_TIMEOUT to 30, quote expansions.

SLOP-344 — stable/debian image cannot start by default

stable/debian/scripts/docker-varnish-entrypoint added an unconditional sleep $SLEEP under set -e. With $SLEEP unset, sleep: missing operand exits 1 and the entrypoint aborts before varnishd.

Verified: /bin/sh -c 'set -e; sleep $SLEEP; echo REACHED' exits 1; with SLEEP=0 it proceeds.

Fix: SLEEP="${SLEEP:-0}", sleep only when positive. Behavior for operators already setting SLEEP=n is unchanged.

Both regressions are WikiTeq-specific delta commits from 2023-03-05; upstream varnish/docker-varnish has neither construct, and no other variant in this repo is affected.

Verification

  • bash -n / sh -n clean on both scripts; shellcheck clean on the alpine entrypoint
  • Docker harnesses demonstrating broken-before/fixed-after for all three cases above (default start, reachable target, unset vars)
  • Fixed harness: default start reaches varnishd launch; WAIT_TARGET set still performs the wait and blocks on an unreachable target

tosfos added 2 commits August 22, 2026 16:36
Unconditional wait-for-it.sh on an unset $WAIT_TARGET printed a usage
error and exited 1 under set -e, so the fresh/alpine image could not
start at all unless both variables were provided. Skip the wait when
WAIT_TARGET is empty and default the timeout to 30s.
sleep $SLEEP with $SLEEP unset failed with "missing operand" under
set -e, aborting the stable/debian entrypoint on every default start.
Default to 0 (no wait) and only sleep when a positive value is given.
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c5c83d8-3d6c-4b3f-b55d-5f573abcc58b


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant