Linux For Life

submitted by

https://lemm.ee/pictrs/image/3429a789-340a-4083-886d-99be905282d1.jpeg

Linux For Life
946

Log in to comment

177 Comments

I hate this message

If you hit Ctrl Alt Delete very quickly in succession (I believe it's 7 times in a row) it will bail out from a stop job and proceed with shutting down

Learned that trick because I was so tired of seeing that occur ha. Along that research I swear I recall seeing that it's a KDE/SDDM issue but I might be getting some wires crossed on that (and thus, don't quote me/take my word on that 😅)

Wasn't the systemd dude a Microsoft employee or something?

He wrote Pulseaudio, Avahi, and systemd before joining Microsoft, where he currently works.

So that's the story. SystemD feels very Microsofty, though. A big, opinionated, monolith.

An excellent vid on Why systemD. https://www.youtube.com/watch?v=o_AIw9bGogo

Great talk indeed. And I will quickly acknowledge that something had to be done, and that systemd had the courage to innovate and address the issues. I just wish it did so in a more transparent way to the end user.

For instance: there's a whole established system of dealing with logs in place. Why build a separate one just for your init system? Why binary? Why even integrate it with your init? I'm not saying storing everything on /var/log and using logrotate is ideal or even covers all use cases. But a log management system is its own thing.

That's just an example of how systemd didn't jive with every other subsystem in a Unix like OS. It could have been done in a Unix way - small cohesive tools that are good at one job and can be combined to do more together.

That's where I think he missed the mark when dismissing the monolithic criticism by saying "it's not a single binary so it's not monolithic". Its philosophy is monolithic.

That said, I use systemd on my machines because that's what my do uses and I don't think it's a reason to swap distros. For the same reason I use Linux and not a micro kernel. I.e. philosophy is important, but implementation is importanter.

While monolithic may not be the keep is simple rule aimed for in originally in Unix/Linux, I wonder if it even matters....is there something really gained by init systems that make a difference for the average Linux user?

. philosophy is important, but implementation is importanter

Yes. This is the key

One task lifecycle management tool to bring them all, one tool to find them. One tool to rule them all and in the darkness bind them.

to be honest if that happens its better to understand why that happens, instead of just pulling the plug. maybe a larger program (like firefox) is still exiting and in the middle of saving the session and closing databases. if you pull the plug, it'll corrupt its data, it'll forget your opened tabs and whatnot and you'll be angry

I'm afraid you answered the wrong comment.

well, yeah, maybe it should have gone to the parent comment

Dahm been quite a bit since I've seen this one. Wonder what changed on my system?

Not only do I get this on shutdown I get a job on startup that runs for a minute thirty that looks for a swap partition that I have deleted.

Did you delete it or comment it out in /etc/fstab? Adding
bash noresume
to your boot arguments should also help. You can try that out in "extended options" during boot and add it to /boot/grub/grub.cfg later. Don't forget to run
bash update-grub after editing.

Yeah I just deleted the swap partition without updating anything. I've realized since then I need to update the fstab but I never think about it until the odd time I do a full reboot.

I've had that problem before, I think I had to mess around with my fstab and grub config to fix it.

Yes. Deleting partitions without editing /etc/fstab is a nice way to render your system unbootable.

Only if they are necessary for the boot process I think

You think means you're assuming and relying on assumptions for critical options is deadly: Unless you're adding the "noerror" option to the referring line in /etc/fstab the machine will fail to boot.

As comments below you will need to check /etc/fstab and then run a mkgrub or mkgrub2 command with options like -o (you will have lookup the full string) and it will rewrite the info that the system is told at boot about drive partitions

Systemd moment

systemd moment in the sense that someone not affiliated with systemd used systemd to write a stop job that doesn't terminate quickly? Or that you willingly installed software that brought along a slow stop job with it?

This is like so far away from systemd's fault, idk, it must just be a meme right?

Pretty sure i've had this happen with services i didn't even create, but yeah it was just a joke, i don't care about init systems, but i don't recall this ever happening when i was using runit.

I don't know runit. Maybe runit didn't even have a way to delay or customize shutdown, maybe it always just waits 5 seconds and then forcibly terminates a process, resulting in you never noticing when a cleanup job was too slow. Maybe you just randomly never installed a particular program with a slow shutdown job while using runit. There's a bunch of reasonable explanations and possibilities for why this difference exists, and they can all mean systemd is perfectly reasonable.

Alright man, fact remains i was just making a silly joke, you don't have to be poettering's pr team lol

You're the one who brought up runit and insinuated it doesn't have this problem ¯_(ツ)_/¯

When I forget to close explicitly Steam before shutdown

Praise all the syatemd gods

Is this even true? I am fairly sure that Linux also has a graceful shutdown process, but I'll admit I haven't looked into it.

yeah we have SIGTERM for graceful and SIGKILL for not so graceful shutting down a process.

In order of decreasing politeness: 1, 2, 15, 9 = HUP, INT, TERM, KILL = "Please stop", "Quit it", "I'm warning you" and "BANG"

Hup is frequently just "hey, reread your configuration files and keep going"

True. I think of it more as a semantic shift. In the old days, processes would actually quit and some other process would resurrect it as necessary, but then someone had the idea of having some processes catch the HUP and do all that itself without actually bothering any other processes.

And the implementation might actually involve an exec of the process' own executable, meaning that it actually does self-terminate, but it leaves a child in its place.

9 kills all 9 lives is they way the hpunix guy explained it to me in the mid 90s

This is put so beautifully!

If your app doesn’t respond to SIGTERM gracefully, you need to fix your app. The system did its job as documented.

Linux gives processes a chance to gracefully close. However, it also will absolutely NOT allow a process to hang up the shutdown or restart procedure after a point. If you're using systemd (which there is a good chance you are), it'll count down. If the process hasn't stopped in the time allotted, it gets Old Yellered.

When I use systemctl shutdown it happens instantly

If a process closes immediately from the shutdown command because it isn't doing anything, sure.

Question, what's the default wait time?

Depends on the process. Can be 30 seconds. Can be 5 minutes.

The default in systemd, unless your distribution has modified it either globally, or for a specific service, is 90 seconds

i mean

"a hand pulling the cord out of the wall socket"

I just use scissors, I have so many IECs laying around

Be careful cutting any multi-conductor cable with scissors, there is a solid chance you short the conductors to each other when doing so.

Great way to damage a power cable.

Old wives' tale. I've only ever yanked power cords out of the wall and I've yet to have one go bad on me.

My ex: what charging cables do you have? They last forever, mine break after a year!
Also my ex: so I got a bunch of the same charging cables you have and they all broke after a year

The type of case that plug has in the stock photo is not coming apart without extreme violence.

I like it. Simple but effective.

  1. Linux normally does a nice shutdown as well, unless you force it.

  2. You can force it on windows if you really want.

I'm so tired of linux memes posted/made by people who don't know much about windows or linux.

Windows also has to worry about getting sued by another multinational conglomerate when some idiot loses the only copy if a super critical file because they were too lazy to save and forced their laptop to shutdown so they could pickup lunch.

Yeah. This looks me like a kill -9 to me.

You can force it on windows if you really want.

Please elaborate

Shutdown.exe -r -t 00 -f

Fast , no mucking around with graceful exiting of stuff. Kicks it in the teefs

Also taskkill /im foo.exe /f

Well, that's great for killing one thing, for sure

I use that as a bat file so all I have to do is double click it.

and then you can growl menacingly and say 'don't make me get the bat, punk'

I don’t use windows.

Not sure if this is a joke or serious.

I can't speak for them if they're joking or not but it's something you can absolutely do. *.bat files (short for "batch", as in a batch of commands to execute in sequence) are the script files for the Windows command line, and can be executed by double clicking on them

Thanks, I’m familiar with batch files. This just seems like a very bad way to perform a shutdown, especially when running a UI Desktop windowing system. And even if that shutdown command is fully supported from the GUI, I would guess you need to be admin to run it, which means you can run the bat file as admin, so if you can edit the file or modify the env in which it runs (e.g. PATH) it seems like it could be a security problem. And if you don’t need to be root to run the shutdown command, that seems like its own problem. I suppose Windows still has the “run as administrator” from the context menu so maybe that helps.

Some clarification of the command

-r #restart

-s #shutdown

-t 00 #wait 0 seconds

-f #forced

00?

How many seconds you're prepared to wait for Windows to shutdown.

Yeah, but why 00 and not 00000? Or 0.000?

Because that's how they do it for Gundams

Probably just habit on their part, it's no different than just putting 0

I know! I wasn't sure when I posted it, so stuck to memory to be safe.

I reckon I've confused the double digits needed for the silly shutdown explanation thing (planned/unplanned, various reasons) instead...

lol, I honestly just thought the elite hackers used double zeros and I was just a lazy dummy. Maybe I’m the elite hacker then.

I will just do the update first /s

If -t is specified -f is assumed and redundant, but also it will try to do graceful l, but with a patience of a cranky toddler

Not really. If -f (force) is removed windows will shutdown similar to pressing the shutdown button and will wait for your input regarding open programs. -f is needed to just just “do it” with no hesitation or response from the user.

Straight from the doc

/t <xxx> Sets the time-out period before shutdown to xxx seconds. The valid range is 0-315360000 (10 years), with a default of 30. If the timeout period is greater than 0, the /f parameter is implied.

Sooo when you use the prompt

Shutdown.exe -r -t 00

You would need the -f since we defined the timeout period as 0. Because:

If the timeout period is greater than 0, the /f parameter is implied.

Ah nice. I have only used it with -t 0. I’m glad to have learn something today.

The process manager lets you kill any process.

You can also click the do it anyway button when it's waiting on shutdown, but I've had less consistent success with that.

Back in the day if I wanted to quit Windows the fastest way, I’d rename the c:/windows folder…

Back to the DOS prompt faster than you could blink

Theres a button on the back of the psu that comes in handy a LOT with windows. Useless on linux unless you want to use that button for its intended purpose.

There's also a hardware way, works on practically any device. Phone, tablet, laptop, desktop, etc. Doesn't matter what the OS is.

Press and hold power button for anywhere between 5 - 15 seconds. The second half of this meme describes this method the best, methinks.

Absolutely, if people agree or not, the core windows is still a pretty powerful operating system. Its sad that they are ruining it by adding crap into it.

I'm waiting for pure GNU/NT. It sure as hell ain't Unix!

It was simpler using Linux to just kill things unceremoniously, but my coworkers are also consistently amazed when Epic throws a temper tantrum (rare, but it happens) and I walk over and ctrl-alt-delete and tell it to sit down and shut the fuck up until it's ready to reboot and act right.

Why not Ctrl+Shift+Esc?

Idek what that is I learned ctrl-alt-del 20 years ago and haven't needed to learn anything else since.

So prior to Win 7 or so, Ctrl+Alt+Del brought up the task manager. Now it brings up a lock screen from which you can select additional options.

Ctrl+Shift+Esc pulls up the task manager, like it did back when you learned it.

It's one more click, why fix what ain't broke?

  1. Linux programs either HAVE to be quick while receiving shutdown signal, otherwise the state will be fucked, work will be lost, and people will be mad, and program will stop being used.

  2. Clicking the Windows button to force shutdown will straight up kill the program and won't care at all.

Oh, p-lease, can force it my ass, Linux has never failed to shutdown on me when using plain obvious GUI method. windows - can easily hang on forever as long as computer stays powered. The point of all the memes is exactly insane windows defaults, not the things that can or can't be done by someone with enough knowledge

Yeah this is more of a situation where because more applications are built for windows you're more likely to encounter poor quality application level software on windows than on Linux. Especially if you stay within the walled garden that most distros provide.

People see a pattern with having a lot more problems with applications on windows than they do on linux and wrongly assume it's because of the OS.

It's really silly since there's plenty of real bullshit going on with windows people could meme about. There's no need to make up shit about windows being bad at something it actually does ok with.

Fear will keep them in line

Except Windows doesn’t. You can send WM_CLOSE, but that may not actually bail out of the core loop. PostQuitMessage() works better for some apps, but not at all for windowless CONSOLE subsystem processes. Windows also has a lot of special behavior around generating signals in other processes. It’s a mess.

Like, every time I reboot the reboot UI complains about mysterious, unnamed processes that take suspiciously long to quit.

Having the kernel yank the process out of existence with prejudice is definitely the way to go as apps should be hardened for crashing, anyway.

Ez just nuke processes from the kernel debugger /s

But, real talk, the only comparable thing would be the emergency restart option (go to ctrl+alt+del screen, hold ctrl as you click on the shutdown button)

My work laptop always complains that it can't shut down the "Shutting down" app when it tries to shut down.

My PC randomly does this too with program.exe or something. And the dumbest part is, that as soon as I press cancel to close the program myself, it starts shutting down completely! Doesn't even load back into the OS or something, just continues the shutdown like nothing was wrong in the first place.

Windows: Has a complex and graceful shutdown process to make sure programs never close if there's a problem with them and your computer just stalls on shutdown until you hold down the power button and completely void out the purpose of the graceful shutdown.

Ever tell a pc to shut down and come after work and it's still waiting for click a box.

Ever? Too many times. When I think I've told Windows Update "yes, do all the shit, yes it's fine, yes I'm sure, yes you can do it, yes I really want you to do it, yes I'm sure I really want you to, yes I'm sure I'm sure, yes for the umpteenth fucking time" and switched off my monitor to go home for the weekend, the number of times I've come in on a Monday morning just to find I have to click "yes" yet again then have to sit there watching it grind out its updates.

I just wish they'd add a checkbox, off by default, that says "yes you can do it all, just stop asking stupid fucking questions" that I can click and go home. But for some reason Microwank insist I have to sit there watching that fucking update percentage creep up then endlessly sit at "100% all is done, please wait" for no reason whatsoever.

Oh yeah and there always seem to be way more reboots needed when BitLocker is active. I'm sure 1 reboot is the norm with occasional 2's. But with BL it's usually 5-6 reboots.

I used to work at a place where MS would raise tickets with us and I always wanted to give them the WU treatment. But professionalism always got in the way of "This ticket is 100% complete, you must close and reopen it to continue".

$ kill -L
 1) SIGHUP   2) SIGINT   3) SIGQUIT  4) SIGILL   5) SIGTRAP
 6) SIGABRT  7) SIGBUS   8) SIGFPE   9) SIGKILL 10) SIGUSR1
11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM
16) SIGSTKFLT   17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP
21) SIGTTIN 22) SIGTTOU 23) SIGURG  24) SIGXCPU 25) SIGXFSZ
26) SIGVTALRM   27) SIGPROF 28) SIGWINCH    29) SIGIO   30) SIGPWR
31) SIGSYS  34) SIGRTMIN    35) SIGRTMIN+1  36) SIGRTMIN+2  37) SIGRTMIN+3
38) SIGRTMIN+4  39) SIGRTMIN+5  40) SIGRTMIN+6  41) SIGRTMIN+7  42) SIGRTMIN+8
43) SIGRTMIN+9  44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13
48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12
53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9  56) SIGRTMAX-8  57) SIGRTMAX-7
58) SIGRTMAX-6  59) SIGRTMAX-5  60) SIGRTMAX-4  61) SIGRTMAX-3  62) SIGRTMAX-2
63) SIGRTMAX-1  64) SIGRTMAX

So does kill -4 just make the program a bit poorly?

It starts playing Beastie Boys over PC speaker

Only if you have installed the correct license file.

Linux does give every application time to shut down correctly, but unlike windows, it won't wait for ages until every process is down. Linux WILL shut down in a certain timeframe, whereas windows waits for years if necessary. In my old job, we all had to use windows and I had times where I clicked shut down, turned off my monitor, grabbed my stuff, left and in the next morning, the PC was still on because Notepad refused to just close lmao.

That is what infuriates me so much. Instead of just killing the process after 5 mins of waiting it just cancels the shutdown. Like fuck off with that shit.

Depending on the use case, that can be a good thing or a bad thing

Shouldn’t be the default though.

Ha, you want choice in how your OS functions?
Here, have another bing toolbar for your settings app.

Man I hope next time I press windows and type an application by name, or by executable.exe I get a spinning icon then a stack of unrelated web results that are probably malware.

I don't want my IDE with hours of work to just shut down forcibly.

Then you might not want windows cause Windows forces updates on you whether you want them or not and break things. Linux will happily wait for you to forget for so long it breaks because the target API doesn't accept your old ass code anymore. At least in Linux as long as I don't forget I'm good. I sometimes forget

TBF there are ways to completely disable updates in Windows (I just did in my VM because it should literally only run 3 programs which are not working with wine)

then surely you would not have asked your OS to shutdown? linux does what you ask

I should probably sigterm instead of sigkill, but it sounds far less cool

Don't both GNOME and KDE send sigterm first on shutdown?

Yeah, this meme is bullshit but gets still posted every other month or so. Windows can also just kill a process, similar to sigkill.

I don't mind a bullshit meme, most memes are bullshit. Sometimes the bullshittery itself is the funny bit, or to put it another way, there are times like this where the absurdity of it is what's funny to me. Like, Linux's kill levels operate, as they must, as advice to the running process, because the os has no insight or capability as to how to gracefully close a process - nor should it. It's an impossible task to know what safe cleanup looks like. But I like the image of the Linux penguin shooting Firefox tbqh

I feel this meme was created by someone who didn't actually know Windows in depth and recently learned of the kill command. Which by default just asks the process nicely to terminate itself.

kill -9 does not ask nicely

Linux is actually great if you need to implement graceful shutdown with signals -- I love it all around :)))

The kernel giveth, the kernel taketh away

Closing correctly means the program stops NOW

Close correctly my ass, window's priority is to piss us off.

I've tried to turn a pc off to go to sleep, only to realize in the morning it's still on because some program refused to close.

Now when I see the prompt to force close, I just say yes.

If your code can’t handle a sig9 then your code is weak

sig 9 or sig 9mm - that's the question here

I've never seen anything graceful in windows

Windows: I refuse to shut down because of a, b , c

Me: But I already clos. . .

Windows: No you didnt't, stop lying!

Me : Well, I pressed the X and the window dissappeared.

Windows: Lol, noob. Did you never even heard of a task managers?

windows: "Can't shut down because of the 'Cant shut down' notice"

me: "but..."

"Mmm, that didn't work, try again later I guess? Just stop bothering me with your petty needs and get back to generating monetizable data that I can harvest."

by
[deleted]

Deleted by moderator

 reply
1

"this application is preventing you from shutting down. Go back and save your work: shut down, cancel"

Clicks cancel

Windows: shutting down!

Nothing is graceful about Windows. [=

kill commands make one feel like a Caesar

Kill ‘em all, let God sort ‘em out 🤣

Lol yes. Killall makes one feel like a god.

sudo reboot, that way the gui gets to die in a fire, too!

Personally, I find xkill quite graceful.

one of my favourite things when i switched to linux first was using the meta+Q hotkey to shutdown a program (this was with PopOS i think). with windows there is alt+F4 but some programs only use shift+alt+F4 which makes it a lot more confusing. on top of all that if youre using a laptop then its another keypress for the Fn key in some cases

You literally kill/xkill/killall the program.

In As400, you type PWRDWNSYS *IMMED.

Then you pray it comes back up in a timely manner.

and this how I deleted the file I edited the entire day: shutdown -h now. No go to bed NOW!

Except when you install ESET EFS.... may the guru save your source...

REISUB. I own you machine, and you will do as I say. Reboot.

Kill commands make me look like a CS:Go Civilian

To the people complaining Windows has an aggressive method. Sure but I didn't know about it till now. Task manager didn't make it obvious to me and so I didn't know about it till now (and everyone keeps talking about commands and shutdowns so it doesn't even sound like you can do it through task manager). Linux's system manager did and I have known about it since first using Linux (about half a year ago now)

Laughs in Sierra

elaborate please

old sierra DOS games, uh, they fucked up the code when exiting so they'd just crash. so they changed the error code to say "thanks for playing Kings Quest" or something similiar

Are you sure your currently updating?

YES DO AS I SAY!

user@debian> |