The difference between Linux signals Sigterm, SIGKILL, SIGINT, and Sigquit

Source: Internet
Author: User
Tags terminates

Sigterm is a signal that a kill sends without parameters, meaning that the process terminates, but execution depends on whether the process is supported or not. But unlike Sigkill signals, it can be captured and interpreted (or ignored) by the process.

Sigkill is a signal sent to the processing to terminate immediately. When sent to the program, the Sigkill terminates it immediately. In contrast to Sigterm and SIGINT, this signal cannot be captured or ignored, and no cleanup can be performed during the reception to receive the signal.

SIGINT interrupt signal, the terminal in the user presses CTRL + C to send to the foreground process. The default behavior is to terminate the process, but it can be caught or ignored.

Sigquit is the signal that its control terminal sends to the process and executes the core dump when the user requests it. Sigquit can usually be ctrl+\. It can be captured and interpreted (or ignored).


Here's an example

You can see a list of Linux supported signals:

~$ kill-l
1) sighup 2) SIGINT 3) Sigquit 4) Sigill
5) sigtrap 6) SIGABRT 7) Sigbus 8) SIGFPE
9) SIGKILL R2
Sigpipe) sigalrm) sigterm sigchld
Sigcont) SIGSTOP
) SIGTSTP (MB) (m) Sigurg) (SIGXCPU) Sigxfsz
) sigvtalrm) sigprof) sigwinch) Sigio ()) SIG (MB) Rtmin) sigrtmin+1 (sigrtmin+2) sigrtmin+3) sigrtmin+4) sigrtmin+5
Sigrtmin+6 (42)) sigrtmin+8) sigrtmin+9 (sigrtmin+10) sigrtmin+11) sigrtmin+12) sigrtmin+13
(sigrtmin+14) SIG RTMIN+15) SIGRTMAX-14) SIGRTMAX-13 (SIGRTMAX-12) SIGRTMAX-11) SIGRTMAX-10 () SIGRTMAX-9 AX-8) SIGRTMAX-7 SIGRTMAX-6) SIGRTMAX-5
() SIGRTMAX-4) SIGRTMAX-3) SIGRTMAX-2 () SIGRTMAX-1
64) Sigrtmax

In the

list, the signal numbered 1 ~ 31 is a traditional UNIX-supported signal, unreliable (non-real time), and the signal numbered 32 ~ 63 is later expanded to call it a reliable signal (real-time signal). The difference between unreliable and reliable signals is that the former does not support queuing and may result in loss of signal, which does not.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.