218 points

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.

permalink
report
reply

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.

permalink
report
parent
reply
55 points

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.

permalink
report
parent
reply
1 point

I haven’t tried this, but if you just need the parent to call waitpid on the child’s pid then you should be able to do that by attaching to the process via gdb, breaking, and then manually invoking waitpid and continuing.

permalink
report
parent
reply
17 points

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)

permalink
report
parent
reply
13 points
*

Performance is the major flaw with microkernels that have prevented the half-dozen or more serious attempts at this to succeed.

Incurring context switching for low-level operations is just too slow.

An alternative might be a safe/provable language for kernel and drivers where the compiler can guarantee properties of kernel modules instead of requiring hardware guarantees, and it ends up in one address space/protection boundary. But then the compiler (and its output) becomes a trusted component.

permalink
report
parent
reply
4 points

Thank you. Came here to say this. Microkernels are great for limited scope devices like microcontrollers but really suffer in general computing.

permalink
report
parent
reply
1 point

where the compiler can guarantee properties of kernel modules instead of requiring hardware guarantees

Then you would need to move compiler to kernel. Well, there is one: BPF(and derivatives). It’s turing-incomplete by design.

permalink
report
parent
reply
8 points

RedoxOS would likely never become feature complete enough to be a stable, useful and daily-drivable OS. It’s currently a hobbyist OS that is mainly used as a testbed for OS programming in Rust.

If the RedoxOs devs could port the Cosmic DE, they’d become one of the best Toy OS and maybe become used on some serious projects . This could give them enough funds to become a viable OS used by megacorps on infrastructures where security is critical and it may lead it to develop into a truly daily drivable OS.

permalink
report
parent
reply
9 points

I believe the next step after that would be to wake up

permalink
report
parent
reply
3 points

They are planning to port Cosmic DE, and have already ported several applications from Cosmic including the file manager and text editor if I remember correctly.

permalink
report
parent
reply
2 points

HURD 2, the return of rust

permalink
report
parent
reply
4 points

What does this have to do with Rust? Or redox, or micro kernels or Linux?

permalink
report
parent
reply

Zombies are usually tied to some resource use. In microkernels, you have more control over the resources.

permalink
report
parent
reply
3 points

I don’t think a microkernel will help with zombies.

permalink
report
parent
reply
1 point

Ok, how change of kernel would fix userspace program not reading return value? And if you just want to use microkernel, then use either HURD or whatever DragonflyBSD uses.

But generally microkernels are not solution to problems most people claim they would solve, especially in post-meltdown era.

permalink
report
parent
reply

This particular issue could be solved in most cases in a monolithic kernel. That it isn’t, is by design. But it’s a terrible design decision, because it can lead to situations where (for example) a zombie process locks a mount point and prevents unmounting because the kernel insists it’s still in use by the zombie process. Which the kernel provides no mechanism for terminating.

It is provable via experiment in Linux by use of fuse filesystems. Create a program that is guaranteed to become a zombie. Run it within a filesystem mounted by an in-kernel module, like a remote nfs mount. You now have a permanently mounted NFS mount point. Now, use mount something using fuse, say a WebDAV remote point. Run the same zombie process there. Again, the mount point is unmountable. Now, kill the fuse process itself. The mount point will be unmounted and disappear.

This is exactly how microkernels work. Every module is killable, crashable, upgradable - all without forcing a reboot or affecting any processes not using the module. And in a well-designed microkernel, even processes using the module can in many cases continue functioning as if the restarted kernel module never changed.

Fuse is really close to the capabilities of microkernels, except it’s only filesystems. In a microkernel, nearly everything is like fuse. A linux kernel compiled such that everything is a loadable module, and not hard linked into the kernel, is close to a microkernel, except without the benefits of actually being a microkernel.

Microkernels are better. Popularity does not prove superiority, except in the metric of popularity.

permalink
report
parent
reply
1 point

But generally microkernels are not solution to problems most people claim they would solve, especially in post-meltdown era.

Can you elaborate? I am not an OS design expert, and I thought microkernels had some advantages.

permalink
report
parent
reply
0 points

nah, you can have micro-kernel features on linux, but you can’t have monolithc kernel features on microkernel, there’s zero arguments in favor of a micro kernel, except being a novel project

permalink
report
parent
reply

ORLY.

Do explain how you can have micro kernel features on Linux. Explain, please, how I can kill the filesystem module and restart it when it bugs out, and how I can prevent hard kernel crashes when a bug in a kernel module causes a lock-up. I’m really interested in hearing how I can upgrade a kernel module with a patch without forcing a reboot; that’d really help on Arch, where minor, patch-level kernel updates force reboots multiple times a week (without locking me into an -lts kernel that isn’t getting security patches).

I’d love to hear how monolithic kernels have solved these.

permalink
report
parent
reply
28 points

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

permalink
report
parent
reply
8 points

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.

permalink
report
parent
reply
8 points

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.

permalink
report
parent
reply
5 points

The normal Windows task manager’s ‘end task’ button just politely asks the app to close - but then later will tell the user if the app is unresponsive, and offer to brutally murder it instead.

There is also the sysinternals Process Monitor, which is basically ‘expert’ version of the task manager. Procmon does allow you to just kill a task outright.

permalink
report
parent
reply
3 points

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.

permalink
report
parent
reply
5 points

Stop jobs are a systemdism and they’re nice. I think the desktop environment kills its children on its own during reboot and it might not be as nice. Graphical browsers often complain about being killed after a reboot in GNOME.

permalink
report
parent
reply
1 point
*

AFAIK running firefox in a terminal and pressing ^C (SIGINT) has kind of the same effect as logging out or poweroff in GNOME (SIGTERM, if you’re using systemd). This gives the browser (or other processes with crash recovery) enough time to save all its data and exit gracefully for the crash recovery the next time they are run.

Please correct me if I’m wrong

permalink
report
parent
reply
4 points

SIGTERM, if you’re using systemd

SIGTERM it was since original init

permalink
report
parent
reply
5 points

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?

permalink
report
parent
reply
13 points

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.

permalink
report
parent
reply
12 points
*

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.

permalink
report
parent
reply
3 points

Windows gives you the option to kill on shutdown if the app is trying to delay the process. I think it’s ideal.

permalink
report
parent
reply
2 points

BTW you can control systemd and how fast it chooses SIGKILL after sending SIGTERM. I don’t know why people complain so much about it. It’s really just there such that things on your computer end properly without any sort of data corruption or something bad going on after a reboot or the next time you turn on your computer.

permalink
report
parent
reply
86 points

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

permalink
report
reply
14 points

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.

permalink
report
parent
reply
8 points

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

permalink
report
parent
reply
6 points

It might be nice and all that (I wouldn’t know), but it’s not a sub- nor superset of glorious POSIX

permalink
report
parent
reply
6 points

Probably because it’s the scripting language equivalent to Clippy. Ref.: Approved “verbs”

permalink
report
parent
reply
4 points

Your opinion is wrong, Powershell must be banished

permalink
report
parent
reply
2 points

Bash already existed

permalink
report
parent
reply
1 point

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.

permalink
report
parent
reply
2 points

I use powershell quite a bit at work and I really like it.

If anything it’s much easier to read than the abomination called bash.

permalink
report
parent
reply
1 point
*

I wanna learn PowerShell but I only really learn extra stuff like that if I have to. My work computer is a Mac now and has been since 2019. At home I don’t use too much on Windows to really warrant it. I did used to know how to do “sudo” in PowerShell which was useful. Best the hell out of restarting as admin.

The “object” approach instead of everything as text seems desirable.

permalink
report
parent
reply
13 points

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

permalink
report
parent
reply
17 points

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

permalink
report
parent
reply
8 points
*

Please do not resist.

permalink
report
parent
reply
6 points

Steam is clunky… Exit -> Oh you want to exit? Let me launch a new window letting you know I’m shutting down and take about 20 seconds while I was sitting here idle before you asked to shutdown.

See you tomorrow where I’ll validate your games again. Just in case!

permalink
report
parent
reply
5 points
*

?

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.

permalink
report
parent
reply
50 points

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.

permalink
report
reply
24 points

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

permalink
report
parent
reply
3 points

Praise be Cortana and IE’s reinstallation!

permalink
report
parent
reply
2 points

F’ing notepad every time.

permalink
report
parent
reply
1 point

This isn’t the default behavior of Win10 Pro without a DC. I don’t know enough about graceful shutdowns to have a perspective. Maybe Home has a different user presentation than Pro?

Unrelated: I’m trying to get from two Virtualbox Mint VMs to one paravirtualized (docker?) image, then to move to physical hardware. When I’m ready, where in the fediverse should I ask for assistance?

permalink
report
parent
reply
47 points
*

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…

permalink
report
reply
24 points

“You should terminate yourself, NOW!”

permalink
report
parent
reply
2 points
*

https://www.youtube.com/watch?v=Fow7iUaKrq4

edit: also 17 FUCKING years ago… GD!

permalink
report
parent
reply
1 point

killall is deprecated, we use pkill now.

permalink
report
parent
reply
37 points

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! 😭

permalink
report
reply
8 points
*

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.

permalink
report
parent
reply
3 points

When I first saw that I was like “great, I have a virus”

Nope, just Windows

permalink
report
parent
reply
4 points

Windows is preventing Windows from shutting down

permalink
report
parent
reply
3 points
*

“restarting” for 15 minutes. Then crashes. Now I have to reinstall updates and go through it all over again. I hate how crappy the windows update process has become.

Except for the immutable versions I have, Linux almost never needs to reboot after an update. Upgrades, yes, but not standard updates. And even after upgrades, it just works [(except for one of the immutable versions I have)].

I usually close all programs before shutting down / rebooting, anyway (a habit I picked up from Win95 days, where it would crash if programs prevented it from shutting down), so I don’t really feel this SIGKILL issues.

permalink
report
parent
reply
2 points

As Microsoft adds ads in more places more and more, I consider moving over to Linux but I just have too many files and weird Windows only programs that I use that I can’t

I also haven’t really found a desktop environment I really like yet, so I’m open to suggestions for dual booting!

permalink
report
parent
reply
1 point

I pretty much always recommend Linux Mint Cinnamon for anyone entering Linux for the first time or anyone who wants something to just work 98% of the time. I use Mint Debian Edition (testing it out. So far, so good, and it’s quickly entering first place in terms of recommendations, as it seems just as stable and uses Debian packages instead of Ubuntu’s), OpenSuse with KDE (less for beginner’s and more for those who want “eye candy” and some nostalgia), and Fedora Silverblue (currently have an update issue with its certificates, so can’t really recommend it yet). I’ve found very few Windows programs to not work within WINE (more complex, system file dependent programs generally are those that fail), so you may find that all of your Windows-only programs work perfectly fine under WINE.

With Mint (and others, I’m sure), you can install multiple DEs and test them out, then remove those you don’t like. Or keep them all and play DE roulette I guess lol

permalink
report
parent
reply
0 points

Linux almost never needs to reboot after an update

Doesn’t it often need a reboot to apply some updates?

I rember reading something along those lines then I was researching why Fedora installs some updates after a reboot. Most

permalink
report
parent
reply
1 point

Fedora is the immutable I was referring to that does need to reboot. Linux Mint and OpenSuse only need to reboot after an upgrade. I’ve never had to reboot them after updates. Mileage may vary, of course, as different people have different software, tools, and libraries installed.

permalink
report
parent
reply

linuxmemes

!linuxmemes@lemmy.world

Create post

Hint: :q!


Sister communities:

Community rules (click to expand)

1. Follow the site-wide rules
2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack members of the community for any reason.
  • Leave remarks of “peasantry” to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • These rules are somewhat loosened when the subject is a public figure. Still, do not attack their person or incite harrassment.
3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn. Even if you watch it on a Linux machine.
4. No recent reposts
  • Everybody uses Arch btw, can’t quit Vim, and wants to interject for a moment. You can stop now.

Please report posts and comments that break these rules!

Community stats

  • 6.6K

    Monthly active users

  • 1.3K

    Posts

  • 69K

    Comments