Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The problem is though that that just lists the names. It doesn't actually explain anything about what they do. And frankly I don't quite know the answer either. I've never found anything that definitively explains what all those listed signals are supposed to do.
I do know that SIGKILL is considered the sledgehammer of process destruction, immediately terminating it without any cleanup whatsoever. It can trash filesystems, corrupt files, and do other damage, so most net advice says to never* use it.
SIGTERM, OTOH, is a much more gentle signal that gives the process a chance to clean up and terminate properly. It's the one you generally should be using first when trying to stop a misbehaving process.
*In my experience though, I can't see how that's really possible. When you have a process that isn't responding to anything, and you have to stop it somehow, what else is there to use?
I do know that SIGKILL is considered the sledgehammer of process destruction, immediately terminating it without any cleanup whatsoever. It can trash filesystems, corrupt files, and do other damage, so most net advice says to never* use it.
In short, there are two types of signals. One type is the non-catchable signal like SIGKILL and SIGSTOP; the other type, catchable, covers the rest.
When a process receives a signal, the signal handler (if one exists within the process) is invoked. The process can choose to do something in response to the signal, or it can just ignore it. The various signal types indicate what a process is supposed to do when it receives a certain signal, but whether a given process actually follows these guidelines is quite another matter.
SIGKILL and SIGSTOP are handled by the OS (I believe they are the only ones, but I could be wrong) and cannot be "caught" by a signal handler. SIGKILL terminates the process and frees any memory it was using, while SIGSTOP stops/pauses the process until a SIGCONT is sent.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.