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?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
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