Windows' Undocumented “Emergency Restart”
old.reddit.com
old.reddit.com
It'd let you safely shutdown when the computer is locked up otherwise.
They aren't exactly the same thing, I suppose, but there's enough functional overlap that if you already have one, it's hard to justify adding another. You don't want too many of these "escape sequences", because every kernel-side keyboard interrupt becomes a thing that:
* Userland doesn't get to use that keyboard shortcut any more.
* Someone might accidentally trigger, and if they don't know what's going on, they become stuck.
* It's another thing that anyone building a captive kiosk has to know how to disable.
It can also be challenging to actually input a magic-sysrq combo on many modern keyboards where sysrq isn't its own key, if it's labeled at all as some Fn-key contortion.
Ages ago I worked with a small team of young sysadmins who would often cause trouble for one another abusing things like sysrq, or poorly configured XFree86 instances without DontZap enabled (ctrl-alt-backspace termination, to a shell when startx/xinit is being used). Most of the time nothing malicious was actually done. But when you return to your screen-locked X desktop to find a fullscreen VC with a root shell blinking back at you and an empty history, guess what you'll at least have on the back of your mind for the rest of the workday?
Windows since 8 has worked on hardening/strengthening the "Secure Desktop" that login flows (and UAC prompts) happen on so that as much as possible malware shouldn't be able to run in those sandboxes.
[0] https://docs.microsoft.com/en-us/windows/security/threat-pro...
It may always work from the kernel's standpoint, but this doesn't necessarily make it usable.
Anything that blocks the display of WinLogon (e.g., the GPU has crashed and is unresponsive) would render this emergency restart mechanism unusable, and typically, situations like this are usually the only time I would need such a feature.
Happy to be corrected by someone who knows more about the windows kernel. :)
Are there any where holding the power button for 10-15 seconds doesn't work? This has always been a reliable technique for me, when using linux on numerous different laptops from different manufacturers.
Win9x "tried" to intercept it; but was never 100% successful.
I wonder what the history behind this feature is.
https://www.codeproject.com/Articles/34194/Performing-emerge...
>After a bit of testing with Restart-Computer and shutdown /r /f, I've found that no officially-documented shutdown command or function comes close in speed -- they both take a fair bit of time to work, and importantly, they both register in the Event Log as a clean shutdown. So what's going on here?
IME shutdown -r now definitely takes it sweet time (ie. getting stuck on "A stop job is running ..."
Trying to unmount a manually mounted network drive after already taking down the network... very frustrating. Seeing the time remaining counter jump from 30 seconds to 2+ minutes after the first 30 seconds passes is rage inducing. Do I really need to read the jargon dense documentation for a damn init system to get my computer to behave in a sensible way? Thanks Lennart.
-f / --force : "Force immediate halt, power-off, or reboot. When specified once, this results in an immediate but clean shutdown by the system manager. When specified twice, this results in an immediate shutdown without contacting the system manager."
"...all processes will be killed forcibly and all file systems are unmounted or remounted read-only. This is hence a drastic but relatively safe option to request an immediate reboot. If --force is specified twice for these operations, they will be executed immediately without terminating any processes or unmounting any file systems. Warning: specifying --force twice with any of these operations might result in data loss."
https://www.kernel.org/doc/html/latest/admin-guide/sysrq.htm...
echo 1 > /proc/sys/kernel/sysrq # enable sysrq
echo o > /proc/sysrq-trigger # immediately power off