Can root kill init process (the process with pid 1)? What would be its consequences?
|
By default, no, that's not allowed. Under Linux (from
Pid 1 (init) can decide to allow itself to be killed, in which case the "kill" is basically a request for it to shut itself down. This is one possible way to implement the On a Mac, killing
UPDATE: On Linux, |
||||
|
|
|
The SysV init ignores SIGKILL or SIGTERM signals. The only signal that causes a change in state is SIGPWR as far as I can tell, which schedules a power-related shutdown. It appears that Upstart and Systemd also do not respond to SIGKILL, and from my test, it appears that a SIGTERM causes upstart and systemd to re-exec. I'm not sure what the other answerers are running but I'm pretty sure you can't kill -9 (SIGKILL) or kill -15 (SIGTERM) init (pid 1). Most likely, if you were able to, you'd get a kernel panic because init unexpectedly exited with a non-zero exit code, which would be less than ideal. It doesn't shut down your computer, or cause it to reboot. |
||||
|
|
|
You can restart the
Source: http://www.cyberciti.biz/faq/linux-unix-kill-hup-1-reread-etcinittab-file/ |
|||
|
|
|
Technically yes, root can issue a SIGKILL to init. init, however, differs from most, nearly all in fact, other processes in that it is permitted to trap and ignore the signal. You can, loosely, kill init by issuing a Please note: performing this command will shutdown your system. For flavor; one type of other process that can "ignore" a SIGKILL is one in uninterruptible sleep, such as one waiting for i/o. Such a process could be found by issuing a |
|||
|
|
No, you cannot kill init. (The 30 character minimum is really annoying...) |
|||||
|