unregister_restart_handler(9)
π unregister_restart_handler β bestie, it's giving "cleanup era" π
okay so this is a page from the Kernel API Manual, and honestly? It's a short one, but it's important, so let's lock in πβ¨
πΈ NAME πΈ
unregister_restart_handler β literally just unregisters a restart handler that you (or someone) already registered. That's it. That's the whole vibe. Undo the thing you did π«Ά
β¨ SYNOPSIS β¨
int unregister_restart_handler (struct notifier_block *nb );
likeβ¦ one argument. one int back. we love a low-effort king π
π ARGUMENTS π
nbβ the hook you want to unregister. bestie this is the exact same hook you handed over when you registered it, so don't go making a new one and hoping it works, because it won't π
π DESCRIPTION π
So the whole point: you previously registered a restart handler function, and now you're done with it, so you're calling this to unregister it. Cleanup era. Closure. Moving on. π
And the return value? Iconic and simple:
- returns zero on success π (slay, it worked)
- returns
-ENOENTon failure π (translation: the thing you're trying to unregister wasn't found β no cap, it's just not there)
π₯ SEE ALSO π₯
okay this is the part where the manpage goes full main-character and lists everyone in the group chat, so here we go, no skips, fr fr:
Kernel file ./kernel/reboot.c β and then the whole squad:
emergency_restart(9), register_reboot_notifier(9), unregister_reboot_notifier(9), register_restart_handler(9), do_kernel_restart(9), kernel_restart(9), kernel_halt(9), register_sys_off_handler(9), unregister_sys_off_handler(9), devm_register_sys_off_handler(9), devm_register_power_off_handler(9), devm_register_restart_handler(9), register_platform_power_off(9), unregister_platform_power_off(9), do_kernel_power_off(9), kernel_can_power_off(9), kernel_power_off(9), orderly_poweroff(9), orderly_reboot(9), hw_failure_emergency_action_func(9), hw_failure_emergency_schedule(9), __hw_protection_trigger(9)
likeβ¦ that's a lot of besties. read them all. iykyk π¦
ngl the pairing you probably want is register_restart_handler(9) β because this page is literally the undo button for that one π
π and that's the tea π
this cutie lives in ./kernel, dated October 2026, and yes the header at the top of the original was unregister_restart_handler(9) in the Kernel API Manual β consider it mentioned, consider it iconic, consider it handled πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms