Say I am writing my own init program running on a Linux kernel.
What happens when my init program exits with return value 0 ?
Additionally is the behaviour different if the return value is non-zero?
Say I am writing my own init program running on a Linux kernel.
What happens when my init program exits with return value 0 ?
Additionally is the behaviour different if the return value is non-zero?
What happens when my init program exits with return value 0?
This code, from the find_child_reaper function in kernel/exit.c, is run:
panic("Attempted to kill init! exitcode=0x%08x\n",
father->signal->group_exit_code ?: father->exit_code);
And consequently this message appears on your console:
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000