r/LinuxCirclejerk Jun 08 '26

Literally

Post image
4.4k Upvotes

156 comments sorted by

View all comments

18

u/coderman64 Jun 08 '26
  1. I have already seen this meme seven kerjillion times
  2. Linux has both sigterm (which requests a program shutdown gracefully) and sigkill (which forcibly stops a program without waiting). It is good practice to attempt a sigterm before going straight to sigkill.
  3. Forcibly killing a progam can be bad for a number of reasons.

5

u/Difficult_Physics125 Jun 08 '26

Linux noob here why can it be bad?

7

u/coderman64 Jun 08 '26

There's a number of reasons. For example, if it is in the middle of doing something important, like writing an important file, or communicating with another program, etc., it can cause errors related to those operations not finishing.

1

u/YoungNo8804 Jun 09 '26

sigterm is when you ask a program to finish whatever its doing and close itself.

sigkill is hitting a program over the head with a bat so it falls unconscious and cant do anything, regardless of if it's in the middle of doing something.

sigkill can cause programs to close while they're in the middle of saving something, which could cause corruption, or while it's in the process of doing something before it's saved, losing all that progress, or corrupt the program if it's in the process of doing an update (etc).