What causes Nautilus to restart whenever I kill it?

In htop, I kill Nautilus, and within one second, it's back, with a new PID!

The restarted Nautilus shows in the Processes list, but has no GUI until I manually launch Nautilus... I've heard mention of Nautilus works in lockstep with the desktop... maybe that is the reason(?).

Is there some sort of "watchdog" program keeping an eye on some distro-critical programs? Monitoring Nautilus doesn't seem like a Linux kernel issue, so I just wonder what is happening here?


Solution 1:

Gnome uses a Session Manager (gnome-session) to keep track of what it needs to do. It is responsible for bringing up the whole session, all subprocesses, restoring state and saving it when you log out.

GNOME provides tools to allow your application to run smoothly from session to session. Users can log out with running applications and have those applications fully restored when they log back in. – from the Gnome Documentation Library

Among other things, the session manager tries to keep it's instance of Nautilus running. Nautilus has to register with the session manager for that - which it does by default; naturally, there's a command-line option to disable it:

nautilus --sm-disable

You can kill a running Nautilus process for good by running:

killall -9 nautilus

Solution 2:

As others have mentioned, gnome-session respawns the nautilus process automatically. It also does so for gnome-panel and gnome-wm (which in turn starts the window manager configured by the user, usually compiz or metacity).

This behavior is customizable through the desktop > gnome > session > required_components gconf keys.

required_components gconf keys

Editing these value can be useful if you would like to, for instance, run with out the GNOME Panel and only use Docky or AWN.