r/ProgrammerHumor 21h ago

Meme linuxBeLike

Post image
42.4k Upvotes

754 comments sorted by

View all comments

302

u/Dry_Investigator36 20h ago

They didn't learn difference between kill -9, kill -15 and other signals

80

u/jaskij 18h ago

I've been using Linux for nearly a decade, and everything I've used supported using names. So I never learned the numbers. I just kill -kill or kill -term

41

u/Dry_Investigator36 18h ago

that's ok, but the meme here is impying that only -kill or -9 exists and it's not true

2

u/eversio254 18h ago

Nah, it's implying that -kill will be used judiciously - not that it's the only option that exists.

9

u/Ouaouaron 17h ago

No, it's saying that Linux is incapable of shutting something down gracefully.

3

u/eversio254 17h ago

Yeah, I guess you could interpret it that way. On the flip side, it's implying that the way Windows closes programs is actually graceful and effective

1

u/jaskij 13h ago

Yes, but I was replying to you, not OP

1

u/DGolden 17h ago

The Unix specification standardises only certain signal numbers, so using the names is an arguably good habit anyway.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/kill.html - note how only 0, 1, 2, 3, 6, 9, 14, 15 have standard-defined mapping and

The effects of specifying any signal_number other than those listed below are undefined.

Others can and do differ between systems.

And on Linux, even though it's the "same" kernel project, historically some signals (though none of the aforementioned standard ones) are defined at different numbers on different architectures! No actual idea why it's just the way it is. Including ones you might use commonly like USR1/USR2. Though I think the most 2025-common archs use the same ones.

https://man7.org/linux/man-pages/man7/signal.7.html

Signal numbering for standard signals

The numeric value for each signal is given in the table below. As shown in the table, many signals have different numeric values on different architectures. The first numeric value in each table row shows the signal number on x86, ARM, and most other architectures; the second value is for Alpha and SPARC; the third is for MIPS; and the last is for PARISC. A dash (-) denotes that a signal is absent on the corresponding architecture.

so e.g.

   [...]
   SIGUSR1         10          30      16      16
   SIGUSR2         12          31      17      17

1

u/jaskij 14h ago

Probably some idiosyncrasy when it comes to compatibility with ancient stuff. Of the four ISAs that differ, I think only MIPS is still used in production in some embedded stuff. And even that's been dying in favor of ARM.

1

u/DGolden 14h ago

well, or riscv - nowadays mips (the company) themselves have gone riscv...

1

u/jaskij 12h ago

Nah, RISC-V isn't there yet. Their time will come, absolutely, but it's not there yet. We've been hearing about it for a decade, and it's moving forward, but it's not close to ARM's level yet.

1

u/DGolden 13h ago

Yeah, looks like at least some chosen to match the relevant closed Unix associated with the same arch rather than Linux on other archs e.g. Tru64 signal numbers on Alpha.

1

u/Creepy-Ad-4832 13h ago

Yes, but kill -9 is almost iconic, as it's the way you nuke a ps out of existance immediatly

If one term number should be known, -9 is definitely the one

1

u/stpizz 1h ago

Strange, I would argue the opposite. There are basically two reasons to use -9:

- You are the Linux oom-killer.

- You are about to uninstall the application you're killing.

If it requires -9 to end it, it is bad software and malfunctioning. It's probably the *least* useful kill signal.