What default signal does htop send on kill?
When managing processes in Linux using the htop
interactive viewer, pressing the F9 key (or
k) opens the signal menu to terminate a process. By
default, htop highlights and sends SIGTERM (signal
15) to the selected process. This article explains why SIGTERM
is the default choice, how it operates, and how it compares to the more
aggressive SIGKILL alternative.
Understanding SIGTERM: The Default Choice
In htop, when you select a process and initiate the kill
command, the utility defaults to SIGTERM (Signal number
15). This is a deliberate design choice aligned with standard
Linux system administration best practices.
SIGTERM acts as a polite request for termination. When a program receives this signal:
- It is given the opportunity to catch the signal and handle it gracefully.
- It can save its current state, close open file descriptors, and release network connections.
- It can finish ongoing critical operations to prevent data corruption before exiting.
How to Send a Signal in htop
Navigating the htop interface to manage process signals
is straightforward:
- Launch
htopin your terminal. - Use the arrow keys to highlight the target process.
- Press F9 or k to open the “Send signal” menu on the left side of the screen.
- Notice that 15 SIGTERM is automatically selected by default.
- Press Enter to send SIGTERM, or use the arrow keys to select a different signal.
SIGTERM vs. SIGKILL
While SIGTERM is the default, users frequently navigate to SIGKILL (signal 9) when a process becomes unresponsive. The differences between these two primary termination signals are vital for system stability.
| Signal Name | Signal Number | Can be Ignored? | Use Case |
|---|---|---|---|
| SIGTERM | 15 | Yes | Default, graceful shutdown. Allows cleanup. |
| SIGKILL | 9 | No | Immediate termination. Force-kills stuck processes. |
Because SIGKILL cannot be caught or ignored by the application, the
Linux kernel terminates the process immediately. This leaves no time for
cleanup, which can occasionally result in orphaned child processes or
corrupted files. Consequently, htop defaults to SIGTERM to
ensure system integrity, leaving SIGKILL as a secondary option for
uncooperative software.