this post was submitted on 18 Jan 2024
1055 points (97.7% liked)
Comic Strips
12628 readers
4305 users here now
Comic Strips is a community for those who love comic stories.
The rules are simple:
- The post can be a single image, an image gallery, or a link to a specific comic hosted on another site (the author's website, for instance).
- The comic must be a complete story.
- If it is an external link, it must be to a specific story, not to the root of the site.
- You may post comics from others or your own.
- If you are posting a comic of your own, a maximum of one per week is allowed (I know, your comics are great, but this rule helps avoid spam).
- The comic can be in any language, but if it's not in English, OP must include an English translation in the post's 'body' field (note: you don't need to select a specific language when posting a comic).
- Politeness.
- Adult content is not allowed. This community aims to be fun for people of all ages.
Web of links
- [email protected]: "I use Arch btw"
- [email protected]: memes (you don't say!)
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I don't even get why force shutting a program isn't the fucking default.
Because you run the risk of corrupting files.
And then they'd start doing drugs, gambling, taking bribes ...
And prostitutes. And shiny metal asses.
In fact, forget the closing of programs.
It can be really dangerous for some programs. I don't know too much about Windows, but in Linux, if we try to close a program once, it sends SIGTERM (or SIGINT, I can't remember right now), which basically asks your program to stop. You program can receive that signal and finish things up and exit cleanly. But if your program is deadlocked and can't handle that right now, closing the program again sends it a SIGKILL, which is basically the OS saying, "Get fucked. You're done whether you like it or not."
It's not dangerous for programs, it's dangerous for files it may be editing, like not writing some ending characters that leaves the file in a state that cannot be opened by some applications.
I didn't mean the programs were in danger. When this is done to some programs, it can cause bad things to happen to your computer.
In your application code, you install signal handlers that better shut your application down when the OS asks you to do so. If your application is hogging resources so hard that it can’t shut down without corrupting files it has opened, then fuck your application. There is a reason the OS (or some user) is sending you that signal.
Nah, the OS is not really saying anything. Definitely not to the program. It's more of a 1984 shot in the back of your head while you walk down a corridor kind of situation. Also it's not a gun your bits just vanish in the ether. Then it sends a death certificate to the parent, without further explanation.
Side note: Have you ever used
killall
? Was the standard way to send signals by name instead of PID beforepkill
. I found out the hard way that it does something rather different on other Unices.That depends how you “try to close the program”. Top/htop/btop often SIGKILL by default. As for closing it legitimately, it depends on your WM and xorg vs wayland. On my DWM setup, I have a keybind for a graceful shutdown and one for SIGKILL.
Yes, I intentionally didn't want to provide too many details, as I thought it would just be confusing for someone who doesn't already have a lot of background knowledge on the subject.
But specifically, I was talking about command line programs and ending them with Ctrl-C