---
title: "Signals, shells, and docker: an onion of footguns"
description: "Canceled CI runs kept executing pytest because SIGTERM was never forwarded down a long process chain: ci-agent → docker compose → docker → dumb-init → bash → test_pipeline → pytest."
url: "https://swe.quest/articles/signals-shells-and-docker-an-onion-of-footguns-4676a655661a15a7"
canonical: "https://benchling.engineering/signals-shells-and-docker-an-onion-of-footguns-ee592e2b587b"
source: "Benchling Engineering"
published: "2024-05-22"
difficulty: "medium"
kind: "Article"
reading_minutes: 9
tags: ["linux","containers","debugging","ci-cd"]
---

# Signals, shells, and docker: an onion of footguns

A post on [Benchling Engineering](https://swe.quest/sources/benchling.md), published 2024-05-22, 9 min read, Article. Original: [https://benchling.engineering/signals-shells-and-docker-an-onion-of-footguns-ee592e2b587b](https://benchling.engineering/signals-shells-and-docker-an-onion-of-footguns-ee592e2b587b)

## Summary

Canceled CI runs kept executing pytest because SIGTERM was never forwarded down a long process chain: ci-agent → docker compose → docker → dumb-init → bash → test\_pipeline → pytest. Along the way: non-interactive bash without job control waits for the foreground child instead of forwarding SIGINT; ctrl+c signals the whole foreground process group set via tcsetpgrp; bash and busybox ash exec the last command without forking (dash does not); and PID 1 in a container has no default signal handlers. The actual culprit was a docker compose v2 bug (v2.0.0–v2.19.0) where \`docker compose run\` didn't forward signals, mitigated by tracking and docker-killing containers until the upstream fix.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Linux](https://swe.quest/tags/linux.md) (Infrastructure)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)
- [Debugging](https://swe.quest/tags/debugging.md) (Engineering practices)
- [CI/CD](https://swe.quest/tags/ci-cd.md) (Reliability & operations)

## Prerequisites

- POSIX signals
- Unix process model (fork/exec)
- Docker basics ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))
- shell scripting

## Keywords

Docker Compose, bash, dash, busybox ash, dumb-init, tini, SIGTERM, tcsetpgrp

## Related posts

- [Docker Best Practices: Choosing Between RUN, CMD, and ENTRYPOINT](https://swe.quest/articles/docker-best-practices-choosing-between-run-cmd-and-entrypoint-023cc3644bb13e6a.md): Docker · 2024-07-15 · Medium · 13 min read · Containers, Linux
  RUN executes commands at image build time and creates layers, CMD sets a default command that any docker run arguments replace, and ENTRYPOINT fixes the executable so that run arguments are appended to it.
- [Fixing the Git Blame Beachball](https://swe.quest/articles/fixing-the-git-blame-beachball-d67cc5c16a8fe68b.md): Zed · 2024-05-06 · Medium · 3 min read · Debugging, Performance engineering, Concurrency, Developer tools
  Committing with many files open froze Zed for about 10 seconds.
- [Using modules for Testcontainers with Golang](https://swe.quest/articles/using-modules-for-testcontainers-with-golang-07887e1f0f647794.md): Zalando Engineering · 2023-12-18 · Medium · 4 min read · Testing, Go, Containers
  Testcontainers for Go lets integration tests start real dependencies such as Redis in containers, but raw usage requires knowing ports, wait strategies and environment details.
- [How recurring network maintenance exposed 6 bugs](https://swe.quest/articles/how-recurring-network-maintenance-exposed-6-bugs-e0c55b4aaea1ee8f.md): Jane Street Tech Blog · 2026-10-02 · Hard · 20 min read · Debugging, DNS, Resilience, Functional programming, Linux
  Recurring weekend network partitions caused Jane Street's Kafka relays and consumer-group monitors to segfault, leak hundreds of thousands of sockets, and crash under recovery-time TCP connection surges, and tracing them uncovered six layered bugs.
- [Automating cherry-picks between OSS and private forks — PlanetScale](https://swe.quest/articles/automating-cherry-picks-between-oss-and-private-forks-planetscale-59bbc498348c8501.md): PlanetScale · 2025-01-14 · Medium · 6 min read · Version control, Developer productivity, CI/CD, Open source
  PlanetScale replaced its weekly cron-based cherry-picking and its conflict-replaying git-replay tool with a stateful Vitess cherry-pick bot that continuously syncs OSS Vitess into a private fork.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
