When performing shutdown, the init process calls the function from shutdown.c ( https://github.com/systemd/systemd/blob/main/src/shutdown/shutdown.c ) which prepares the system for power off, such as killing all the other processes and etc. after that it calls the reboot from reboot.c ( https://github.com/torvalds/linux/blob/master/kernel/reboot.c ) which does the final operations to shutdown. I would like to know how the init process himself exists or killed as per the manual, the init process can only receive signals which have installed handlers – https://man7.org/linux/man-pages/man2/kill.2.html. so SIGKILL and SIGTERM might be out of the question. thanks in advance.
bazbaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.