Ubuntu – What causes Nautilus to restart whenever I kill it

command linenautilusprocesssession

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?

Best Answer

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