do_kernel_power_off(9)
π do_kernel_power_off(9) β the Kernel API Manual bestie π
okay so picture this: it's kernel API manual o'clock, and we're learning do_kernel_power_off β the function that literally says "bye bestie" to your whole machine π₯
β¨ NAME β¨
do_kernel_power_off β Execute kernel power-off handler call chain π
π¦ SYNOPSIS π¦
void do_kernel_power_off (void );
πΈ ARGUMENTS πΈ
voidβ no arguments, ngl. zero. nada. it takes nothing and it gives everything π
π DESCRIPTION π
So here's the vibe: this one is expected to be called as the last step of the power-off sequence. like, the final boss of shutting down. the last text before you go to sleep π«Ά
It powers off the system immediately if a power-off handler function has been registered. slay. iconic. the machine is gone.
Otherwise? it does nothing. literally nothing. no handler, no power-off, no drama π
β οΈ heads up bestie β "immediately" is not a little bit immediate. if a handler is registered, the system goes down right then. no take-backs, no vibe check, no saving your unsaved work. π
π§ SEE ALSO π§
okay this list is long but every single one of these is a friend of the function, so let's give them all their moment β¨
Kernel file ./kernel/reboot.c β the whole reboot.c neighborhood, go say hi π‘
emergency_restart(9)register_reboot_notifier(9)unregister_reboot_notifier(9)register_restart_handler(9)unregister_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)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)
π and that's the whole page, bestie!! this came straight out of the ./kernel source in October 2026, and it's filed under do_kernel_power_off(9) in the Kernel API Manual β go power off responsibly, mwah ππ«Ά
π¦ 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