Interview Prep/Docker/Containers that exit, crash or misbehave

PID 1 app doesn't reload on SIGHUP or ignores Ctrl+C in `docker run -it`.

AdvancedTroubleshootingContainers that exit, crash or misbehave
Answer

Likely causes → PID 1 has no default signal handlers; a signal without a handler is ignored.

Diagnose → docker exec c cat /proc/1/status | grep -E 'SigCgt|SigIgn'

Fix → Run --init, or have the app install handlers (Node: process.on('SIGTERM')).

Prevent → Test docker stop time in CI.

All Docker questions Roadmap: Docker & containers

More on Containers that exit, crash or misbehave