this post was submitted on 09 Feb 2024
31 points (94.3% liked)
Linux
48624 readers
1671 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Closing from the X icon on the app window lets the program write out any info it needs to before shutdown. Killing the process from the terminal just ends the process totally
That is not true. If you use SIGKILL (9) it ends the process totally. Other signals don't do that. And per default the cli commands don't send SIGKILL, but SIGTERM. It nicely asks the program to terminate and the program is supposed to write down it's data and do what it needs to do when signaled like that. You'd need to attach a '-9' to kill it without warning. (Even if the command is called 'kill'.)
A lot of GUI apps unfortunately don't catch SIGTERM, so it doesn't make much of a difference. A lot of them put their "exited normally" into the "the window was closed" handler.
For GQRX that might even be intentional, it's very unstable at times, and you do kill it pretty often. So they probably assume if it got SIGTERM, it was frozen and the WM offered the user to kill it and clicked yes.
Sure, ~~if GUI apps don't handle it they just keep running. It's just asking them to terminate.~~ [Edit: I'll try that]
(We could just have a look at the code of GQRX in specific or just try it.)
The default behaviour for SIGTERM (and most other signals) when unhandled is to terminate the process, so you might as well be sending SIGKILL. It won't keep running unless specifically coded to catch the signal and do nothing with it.
then it sounds like what is being killed has another child or parallel process that isn't getting killed by the command used. Or Sigterm 15 is needed for graceful shutdown of process
It's more than an "ask" - if it's not handled then the application will still shutdown. SIGTERM is "trapable" by the application though and should be used to safely terminate.
They'll also want to try SIGINT as that's what ctrl+c sends. The application may handle that one instead.
Only if you -9 it