While troubleshooting a service that has stopped responding to client requests, you decide to attempt a graceful shutdown so the daemon can write its final log entries and close open files. The process ID is 4821. Which kill signal should you send to give the process an opportunity to perform its own cleanup routines before the operating system forcefully terminates it?
When a process receives SIGTERM (signal 15), it can run its own signal handler, close files, flush caches, and release resources before exiting. The kill command sends SIGTERM by default, making it the standard way to request an orderly shutdown. SIGKILL (signal 9) is delivered directly by the kernel and cannot be caught, so no cleanup occurs. SIGQUIT (signal 3) ends the process and writes a core dump, which is useful for debugging but not for routine shutdowns. SIGSTOP (signal 19) simply suspends execution until the process receives SIGCONT and therefore does not terminate the task.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the difference between SIGTERM and SIGKILL?
Open an interactive chat with Bash
How does a process handle SIGTERM?
Open an interactive chat with Bash
What is the role of SIGSTOP if it doesn't terminate processes?