On multiple computers running Ubuntu 14.XX, I ran the command "killall init" as user, and was immediately logged out. I could log back in again without a problem. Why is this? What's going on behind the scenes?

1 Answer 1


On newer Upstart systems, a session init process is started when you login using the GUI. Since Ubuntu uses Upstart, there's an init process for your session. Test it out using pstree -ps $$ in a terminal:

$ pstree -ps $$

So when you run killall init, you're not killing init PID 1 (because you don't have the privilege), but your session init, which would be PID 9526 in this example.

Since this init is the governing process for your GUI session, killing it kills your session and therefore you are logged out.

  • Does killall always send the signal to the closest relative in the process tree? If I ran the command as root (with sudo for example), would I get the same result, or a kernel panic? Jan 28, 2015 at 8:04
  • 1
    @TimSeguine As the name says, it is sent to all processes with this name. BTW, some people prefer pkill instead of killall because killall works completely different on other systems such as Solaris...
    – glglgl
    Jan 28, 2015 at 8:09
  • killall kills all. Hence the name.
    – orion
    Jan 28, 2015 at 12:10
  • 1
    @TimSeguine It sends to all, but if you're an ordinary user you can't send signals to processes of other users. So it only affects the one in your own process tree.
    – Barmar
    Jan 28, 2015 at 18:20
  • Running killall init as root does not seem like a good idea - especially on a useful system - I think init causes a kernel panic if it dies because it is not intended to ever reach a return at the end of it's main code loop.
    – SlySven
    Feb 13, 2016 at 17:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .