Skip to main content
InterviewHubPRO
Section Overview
Q42

Question 42 of 50

Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)

84%
Docker & Containers (50 Qs)•Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)

Signal Handling and the PID 1 Zombie Process Problem.

senior LevelSignalsSecurity & Auth

In Simple Words: When a process runs as PID 1 inside a container, Linux kernel default signal handlers are disabled. If a Java or Node.js process runs as PID 1:

  • It ignores standard SIGTERM signals sent by docker stop, forcing Docker to hang for 10 seconds before violently killing it with SIGKILL (causing database corruption).
  • It does not reap orphaned child processes, resulting in leaked "zombie" processes that exhaust the OS PID table.
  • Solution: Use Tini (docker run --init) or dumb-init as PID 1 to properly forward signals and reap zombie processes.