The following is the GNU All-permissive License as recommended in

Copyright (C) 2024 Free Software Foundation

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.

Contributions are welcome. See

using sysrq to reboot when systemd is broken

This script comes from Bob Proulx:

echo 1 >/proc/sys/kernel/sysrq
echo s >/proc/sysrq-trigger
echo b >/proc/sysrq-trigger

It may also be worth trying to manually kill important processes first, so they have a chance to write out any state to disk before the system halts and immediately reboots.