this post was submitted on 07 Jul 2024
807 points (92.5% liked)

linuxmemes

19849 readers
559 users here now

I use Arch btw


Sister communities:

Community rules

  1. Follow the site-wide rules and code of conduct
  2. Be civil
  3. Post Linux-related content
  4. No recent reposts

Please report posts and comments that break these rules!

founded 1 year ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] bjoern_tantau@swg-empire.de 293 points 1 week ago (7 children)

Fake news.

Both Windows and Linux have their respective SIGTERM and SIGKILL equivalents. And both usually try SIGTERM before resorting to SIGKILL. That's what systemd's dreaded "a stop job is running" is. It waits a minute or so for the SIGTERM to be honoured before SIGKILLing the offending process.

[–] sxan@midwest.social 39 points 1 week ago (33 children)

Also fake because zombie processes.

I once spent several angry hours researching zombie processes in a quest to kill them by any means necessary. Ended up rebooting, which was a sort of baby-with-the bath-water solution.

Zombie processes still infuriate me. While I'm not a Rust developer, nor do I particularly care about the language, I'm eagerly watching Redox OS, as it looks like the micro kernel OS with the best chance to make to it useful desktop status. A good micro kernel would address so so many of the worst aspects of Linux.

[–] CameronDev@programming.dev 76 points 1 week ago* (last edited 1 week ago) (2 children)

Zombie processes are already dead. They aren't executing, the kernel is just keeping a reference to them so their parent process can check their return code (waitpid).

All processes becomes zombies briefly after they exit, just usually their parents wait on them correctly. If their parents exit without waiting on the child, then the child gets reparented to init, which will wait on it. If the parent stays alive, but doesn't wait on the child, then it will remain zombied until the parent exits and triggers the reparenting.

Its not really Linux's fault if processes don't clean up their children correctly, and I'm 99% sure you can zombie a child on redox given its a POSIX OS.

Edit: https://gist.github.com/cameroncros/8ae3def101efc08be2cd69846d9dcc81 - Rust program to generate orphans.

load more comments (2 replies)
[–] MNByChoice@midwest.social 24 points 1 week ago

Zombie processes are hilarious. They are the unkillable package delivery person of the Linux system. They have some data that must be delivered before they can die. Before they are allowed to die.

Sometimes just listening to them is all they want. (Strace or redirect their output anywhere.)

Sometimes, the whole village has to burn. (Reboot)

load more comments (31 replies)
[–] Mojave@lemmy.world 35 points 1 week ago (2 children)

Clicking end task in windows task manager has definitely let the hanging task live in its non-responsive state for multiple hours before.

[–] bjoern_tantau@swg-empire.de 15 points 1 week ago (2 children)

Been a while since I've been on Windows but I distinctly remember some button to kill a task without waiting. Maybe they removed it to make Windows soooo much more user friendly.

[–] Rev3rze@feddit.nl 19 points 1 week ago (2 children)

Off the top of my head: right click the task and hit end process. That has literally never failed me. Back in windows XP it might sometimes not actually kill the process but then there was always the "kill process tree" button to fall back on.

load more comments (2 replies)
load more comments (1 replies)
[–] Aux@lemmy.world 9 points 1 week ago

The end task doesn't terminate the app, it only sends a message to the window to close itself. The app will then decide what to do on its own. For example, if the app has multiple windows open, it might close the active one, but still continue running with other windows open. Or it might ignore the message completely.

[–] SpaceCadet@feddit.nl 11 points 1 week ago (1 children)

That’s what systemd’s dreaded “a stop job is running” is

The worst part of that is that you can't quickly login to check what it is (so maybe you can prevent it in the future?), or kill it anyway because it's likely to be something stupid and unimportant. And if it actually was important, well... it's gonna be shot in the head in a minute anyway, and there's nothing you can do to prevent it, so what's the point of delaying?

[–] bjoern_tantau@swg-empire.de 21 points 1 week ago (1 children)

so what's the point of delaying?

In the best case the offending process actually does shut down cleanly before the time is up. Like, some databases like redis keep written data in memory for fast access before actually writing the data to disc. If you were to kill such a process before all the data is written you'd lose it.

So, admins of servers like these might even opt to increase the timeout, depending on their configuration and disc speed.

[–] SpaceCadet@feddit.nl 12 points 1 week ago* (last edited 1 week ago)

I know what it theoretically is for, I still think it's a bad implementation.

  1. It often doesn't tell you clearly what it is waiting for.
  2. It doesn't allow you to checkout what's going on with the process that isn't responding, because logins are already disabled
  3. It doesn't allow you to cancel the wait and terminate the process anyway. 9/10 when I get it, it has been because of something stupid like a stale NFS mount or a bug in a unit file.
  4. If it is actually something important, like your Redis example, it doesn't allow you to cancel the shutdown, or to give it more time. Who's to say that your Redis instance will be able to persist its state to disk within 90 seconds, or any arbitrary time?

Finally, I think that well written applications should be resilient to being terminated unexpectedly. If, like in your Redis example, you put data in memory without it being backed by persistent storage, you should expect to lose it. After all, power outages and crashes do happen as well.

load more comments (4 replies)
[–] MonkderDritte@feddit.de 170 points 1 week ago (2 children)

SIGTERM is the graceful way tho? It nicely asks programs to please close and cleanup. Unlike SIGKILL, which bombs the shop and creates orphans.

[–] Thann@lemmy.ml 37 points 1 week ago (3 children)

And we give steam a fewilliseconds to comply, so IDK what they're complaing about...

[–] meleethecat@lemmy.world 53 points 1 week ago (1 children)

Please end your process. You have ten milliseconds to comply.

[–] Yearly1845@reddthat.com 14 points 1 week ago* (last edited 1 week ago)

Please do not resist.

[–] MonkderDritte@feddit.de 9 points 1 week ago* (last edited 1 week ago)

?

You're supposed to close Steam via menu or systray. If you run it in cli, you see that it cleans then a whole bunch up for a few seconds.

load more comments (1 replies)
[–] SpaceCowboy@lemmy.ca 17 points 1 week ago (3 children)

Yup. And you can kill processes in Windows to in the task manager. Or probably with a Powershell command too, but nobody's gonna learn Powershell LOL.

There's nearly always equivalent functions in both Linux and Windows, just in Windows you gotta click around in more bullshit forms and shit to find stuff. Or learn Powershell, but again, LOL. They are both OSes after all, they do similar things. Just one might do them better than the other.

[–] capital@lemmy.world 10 points 1 week ago (12 children)

Why u gotta hate on PowerShell like that? I like it. 😭

[–] SpaceCowboy@lemmy.ca 1 points 5 days ago (1 children)

It's one of those things wher eI'm sure it's fine if you learn it. But it's not DOS CMD, but also not bash.

So instead of improving CMD to have more features or just going all the way and offering an official bash implementation, they want me to learn a third thing. Just don't have time for it.

[–] capital@lemmy.world 1 points 5 days ago (1 children)

It’s second to none if you have to get things done in a Windows environment, especially if dealing with Active Directory.

But if not, I don’t blame you for not picking it up. Right tool for the job and all that.

[–] SpaceCowboy@lemmy.ca 1 points 4 days ago

I do use it occasionally, but I gotta google for the command every time. So not exactly learning it.

load more comments (11 replies)
load more comments (2 replies)
[–] Ironfacebuster@lemmy.world 71 points 1 week ago (12 children)

Almost every time I restart my Windows PC from an update, it sits on the "closing apps screen" or "restarting" screen then gives up completely and I have to force it to shut down/restart

And, just about every other time I restart with an update, it closes apps and then just fully shuts down after the update!

It's super graceful! 😭

[–] MonkeMischief@lemmy.today 25 points 1 week ago* (last edited 1 week ago) (2 children)

EVERY TIME!!

"A program is preventing Windows from shutting down"

The program : A generic non-descript white box icon with no title.

Clicking shutdown/restart anyway becomes standard procedure at this point.

load more comments (2 replies)
load more comments (11 replies)
[–] NeatNit@discuss.tchncs.de 62 points 1 week ago (3 children)

Windows' might be complex, but it is NOT graceful. If you have notepad open with unsaved text, then shutdown will never shut down - but nothing on the screen will make this obvious to a non-technical person.

[–] chellomere@lemmy.world 30 points 1 week ago (1 children)

Unless there are security updates to install, then everything will be mercilessly killed

load more comments (1 replies)
load more comments (2 replies)
[–] Laser 51 points 1 week ago* (last edited 1 week ago) (3 children)

SIGTERM is a graceful request to the application to terminate itself and despite their names kill and killall default to SIGTERM (also useful to send other signals to processes, like START, STOP and NOHUP).

kill -9 though...

[–] RustyNova@lemmy.world 28 points 1 week ago

"You should terminate yourself, NOW!"

load more comments (2 replies)
[–] phoenixz@lemmy.ca 33 points 1 week ago (3 children)

Linux actually also has a graceful shutdown process. It tells apps its shutting down by sending SIGTERM, and its up to each process to flush data asap, do whatever they gotta do, and then shut down.

If they don't listen then linux will indeed pull out the ~~baseball bat~~ ~~chainsaw~~ katana and make processes die whether they want to or not.

load more comments (3 replies)
[–] BmeBenji@lemm.ee 28 points 1 week ago* (last edited 1 week ago) (2 children)

The number of times I have had the Windows shutdown process tell me “please close <some windows process that I never opened> before shutting down” is fucking annoying. Wipe your own ass, Windows.

[–] SkaveRat@discuss.tchncs.de 14 points 1 week ago

Bonus points if that exact dialogue is the cause. Had that happen more than once. No idea how

load more comments (1 replies)
[–] dan@upvote.au 20 points 1 week ago (2 children)

The image fails to load for me.

[–] ikidd@lemmy.world 23 points 1 week ago

pkill -9 firefox

load more comments (1 replies)
[–] nucleative@lemmy.world 19 points 1 week ago (5 children)

EarlyOOM is your friend. Tweak it to save the most important stuff and kill irrelevant stuff first when low on memory.

load more comments (5 replies)
[–] jet@hackertalks.com 19 points 1 week ago (9 children)

Every computer should have a hard cutoff power switch, when thrown it cuts all physical electricity.

Off means off.

The current trend of soft power buttons, parasitic loads to service impi, or management engines wol, etc is just bad practice and removes agency from the user.

Who hasn't wanted to turn off a laptop to put it in a bag only for the shutdown to trigger an update that takes 10m whole your running late, so the laptop overheats. Or worse, the laptop turns on while in the bag!

The fact windows has a poor ability to apply updates live or In a a/b fashion is no excuse for soft poweroff buttons. Sure it's nice to flush file system write through caches, but Ive been burned by fake power off far more then incomplete file writes.

load more comments (9 replies)
[–] Beaver@lemmy.ca 17 points 1 week ago

Firefox is becoming the villain.

[–] OR3X@lemm.ee 17 points 1 week ago (2 children)

Meanwhile Windows regularly gets hung up for several minutes on the "shutting down..." screen for no fucking reason. Only happens when I'm in a hurry too.

[–] Tryptaminev@lemm.ee 9 points 1 week ago (1 children)

i love it when the "this program is keeping the computer from shutting down" program is the shutting down program

load more comments (1 replies)
load more comments (1 replies)

Meanwhile I click that "shut down anyway" button immediately. Fuck you Outlook.

[–] then_three_more@lemmy.world 14 points 1 week ago (2 children)

In windows open command prompt type

shutdown /f /s /t 0

[–] Zacryon@lemmy.wtf 16 points 1 week ago* (last edited 1 week ago)

Translation:
"Shutdown. Fucking shutdown, trash!"

[–] Agent641@lemmy.world 11 points 1 week ago

Better yet, put this in a batch file set to run at start up. On your friends PC of course

[–] uis@lemm.ee 13 points 1 week ago (2 children)

echo b > /proc/sysrq-trigger

load more comments (2 replies)
load more comments
view more: next ›