register_reboot_notifier(9)
β¨ register_reboot_notifier(9) β the kernel API manual glow-up β¨
okay so bestie, welcome to the register_reboot_notifier(9) page π
this is a Kernel API Manual entry and honestly? it's a little baddie with one job and it does it perfectly π
πΈ NAME πΈ
register_reboot_notifier β literally just: register a function so it gets called at reboot time β like, that's the whole vibe. reboot era incoming π₯
π SYNOPSIS π
int register_reboot_notifier (struct notifier_block *nb );
that's it, that's the whole signature, no cap π«Ά
π¦ ARGUMENTS π¦
nbβ info about the notifier function that's gonna get called π this struct is the whole personality holder: it's where you tell the kernel which function to ring up when reboot o'clock hits π
π§ DESCRIPTION π§
okay so what this does: it registers your function into the list of functions that get called at reboot time πβ¨ so when the machine goes down for its little reboot nap, your function is on the guest list π
and here's the iconic part β it currently always returns zero, because blocking_notifier_chain_register always returns zero. so the return value is giving zero, slay, no drama, no surprises πβ¨
lowkey important: this isn't us guessing at behaviour, it's literally in the docs β the "currently" is doing a lot of work there, iykyk π
π SEE ALSO π
- Kernel file
./kernel/reboot.c emergency_restart(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)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)
the way that's a whole friend group of reboot/shutdown besties ππ«Ά go read them all, fr fr.
and that's the page!! π before you go: this lil masterpiece lives in the ./kernel source tree, it's October 2026 energy, and it's filed as register_reboot_notifier(9) β go forth and be the main character of your own notifier chain ππ
β¨
π¦ 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