News for hackers. Stuff that matters.
Re:Windows' Undocumented “Emergency Restart” by mrtesthah on Tuesday July 05, 2022 @12:25PM (#31990285)
Sounds like the Windows equivalent of shutdown -r now
Re:Windows' Undocumented “Emergency Restart” by gruez on Tuesday July 05, 2022 @12:31PM (#31990371)
No, not really, from the OP

>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 ..."

Re:Windows' Undocumented “Emergency Restart” by memcg on Tuesday July 05, 2022 @01:19PM (#31990994)
Sysinternal's "pskill csrss" used to be my last resort to reboot remote or local desktops and VMs. Saved my ass many times.
Re:Windows' Undocumented “Emergency Restart” by mrtesthah on Tuesday July 05, 2022 @01:13PM (#31990909)
It's pretty quick on macOS.
Re:Windows' Undocumented “Emergency Restart” by robonerd on Tuesday July 05, 2022 @01:51PM (#31991434)
> (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.

Re:Windows' Undocumented “Emergency Restart” by kevinoid on Tuesday July 05, 2022 @12:50PM (#31990614)
Perhaps a closer analog would be halt(8) with the -q (BSD) or -f (Linux) option to avoid calling init(8):

https://man.openbsd.org/halt

https://manpages.debian.org/halt

Re:Windows' Undocumented “Emergency Restart” by chasil on Tuesday July 05, 2022 @01:51PM (#31991429)
On my RHEL systems:

-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."

Re:Windows' Undocumented “Emergency Restart” by mrtesthah on Tuesday July 05, 2022 @01:13PM (#31990922)
Yes, that's what I was thinking of.
Re:Windows' Undocumented “Emergency Restart” by forgotpwd16 on Tuesday July 05, 2022 @12:55PM (#31990681)
This is a normal reboot. If anything seems more like a reboot issued via magic system request.
Re:Windows' Undocumented “Emergency Restart” by dinom on Tuesday July 05, 2022 @01:05PM (#31990805)
Agreed, seems to be exactly this.

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