Interview Prep/Linux/Processes, Signals & systemd

Why should you send SIGTERM before SIGKILL?

BeginnerConceptProcesses, Signals & systemd
Answer

SIGTERM lets the process run its handler: finish in-flight requests, flush buffers, close DB connections, remove lock files. SIGKILL ends it instantly with no cleanup, risking corrupted data and leftover locks. systemd and Kubernetes both send SIGTERM, wait a grace period (TimeoutStopSec, terminationGracePeriodSeconds), and only then SIGKILL.

All Linux questions Roadmap: Linux

More on Processes, Signals & systemd