28

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?

Peter.O
  • 25,251

6 Answers6

20

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

RolandiXor
  • 51,797
11

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.

6

gnome-session is responsible for respawning nautilus. As its parent in the process tree, there is no other process that could respawn it.

ps -eaH shows you the hierarchical process tree excerpted here:

    1 ?        00:00:00 init
 1113 ?        00:00:00   gdm-binary
11391 ?        00:00:00     gdm-simple-slav
11396 tty8     00:00:13       Xorg
11465 ?        00:00:00       gdm-session-wor
11629 ?        00:00:00         gnome-session
11746 ?        00:00:02           nautilus
msw
  • 4,696
5

Chipaca & andrewsomething are both close... :)

The /desktop/gnome/session/required_components_list key lists the "components" that should be monitored by gnome-session, and restarted automatically when they exit. The default value for GNOME 2 is something like [windowmanager,panel,filemanager].

If you want to prevent nautilus (or whatever "filemanager component" you have configured) from getting (re)started by this mechanism, you can change the value to [windowmanager,panel]. (You can still have it start during login by adding it to the list of session start-up programs of course, but it won't get restarted automatically anymore.)

What application (with what commandline parameters) gets started for each component is defined under /desktop/gnome/session/required_components in a key with the name of the component. It is possible that more components are listed here than are used in the /desktop/gnome/session/required_components_list key.

Now, in case of nautilus, by default when it is not running yet it starts in the background, and if the /apps/nautilus/preferences/show_desktop key is set it also shows the Desktop. It is also possible to tell nautilus to behave differently with commandline parameters.

JanC
  • 19,802
2

Nautilus is being restarted because you have it drawing the desktop. Enter

gconftool-2 --type bool --set /apps/nautilus/preferences/show_desktop False

in a terminal for it to stop doing that, and it then shouldn't come back after killing.

Isaiah
  • 60,750
Chipaca
  • 10,130
0

in total do:

gconftool-2 -s -t bool /desktop/gnome/background/draw_background false
gconftool-2 -s -t bool /apps/nautilus/preferences/show_desktop false

and

sudo gedit /usr/share/applications/nautilus.desktop

change to:

X-GNOME-AutoRestart=false

(found it at: https://bbs.archlinux.org/viewtopic.php?id=119254 )

thats all...

O...
  • 11