T38 Dec 19, 2025 2 min read

Exit code

A small integer a process returns on exit to indicate success (usually 0) or failure (non-zero) to whatever started or supervises it.

Definition

An exit code is a small integer a process reports when it terminates. By convention:

  • 0 means success
  • non-zero means failure (or a specific failure category)

Exit codes are how a process communicates “how it ended” to the thing supervising it (shell, service manager, container runtime, orchestrator).

Why exit codes matter

Exit codes influence automation:

  • whether a process is restarted
  • whether a deploy is considered successful
  • whether monitoring marks an instance as unhealthy

They’re a simple interface, but they’re often the first clue in an incident.