Debugging is a process, so I will describe the process that I would use to attack such a problem. The questions are:
- does it work for a new user account? (ie. is it a generic problem with the system, or with one account?)
- how is it supposed to be started?
- is it actually being started?
- if so, is it crashing or otherwise failing? (This is perhaps more likely than it not being run in the first place, and the results are similar)
If it is a problem with an account (user config), and it works with a newly created account, then you can track the problem down by copying config files from the broken account to the working account, and testing login, until it breaks. (Or, alternatively, start with the broken account, and remove files and directories until it works.) Approach this as an iterative process - begin, copy a directory/file set, did it break the account yes/no, eliminate half the set, goto begin. It can be time consuming, so usually people will just reset the account and not bother to track down what broke.
If you want to track down the software source of the problem, first look in ~/.cache/gdm/session.log and /var/log/syslog to see if there are any obvious errors related to your problem. Then use the source:
$ apt-file search gnome-settings-daemon-localeexec
$ apt-get source gnome-settings-daemon
$ cd gnome-settings-daemon-*
$ grep -r gnome-settings-daemon-localeexec
$ cat data/gnome-settings-daemon.desktop.in.in
_Name=GNOME Settings Daemon
So now we know gnome-settings-daemon-localeexec is run from a .desktop file called gnome-settings-daemon.desktop. Where is it installed?
$ locate gnome-settings-daemon.desktop
$ file /usr/lib/gnome-settings-daemon/gnome-settings-daemon-localeexec
/usr/lib/gnome-settings-daemon/gnome-settings-daemon-localeexec: POSIX shell script, ASCII text executable
$ vi /usr/lib/gnome-settings-daemon/gnome-settings-daemon-localeexec
# it is just a wrapper around /usr/lib/gnome-settings-daemon/gnome-settings-daemon
Try to run it to see if there is a problem running the actual daemon (crashing etc.):
You can also try:
$ gnome-settings-daemon --debug
Is the autostart being run? Searching for "debug gnome autostart" results in this page, which suggests:
To enable debugging, set the debug/Enable key to "true" in the
/gdm/custom.conf file and restart GDM.
So try that, and then check /var/log/syslog. Another alternative here is to modify /usr/lib/gnome-settings-daemon/gnome-settings-daemon-localeexec and add debug statements. It is just a shell script, so add something like
echo "localeexec date $(date) env $(env)" > /tmp/log. Then log in and check /tmp/log.
(When debugging any given program there is usually a way to append your print statements to a "proper" log file, but opening your own log file is often easier and quicker, as it keeps your debugging separate, and does not require understanding the multiple layers of language/system/loglevel/filtering that are in place for any given program.)
The logging and debugging so far will probably have exposed the issue. For harder bugs, that lie in the compiled binaries, you will have to download the source with
apt-get source, modify it to add some debugging code (print statements), compile the modified source and install it, and then test it. The great thing here is that the whole
apt/dpkg system is designed to make this easy, quick and accessible with only a few commands. A debugger can be useful for examining complex internal program state, but using print statements is a faster process that works across all languages and systems, so that is usually my initial approach.
As a summary of the comments, I've replaced the line in /usr/lib/gnome-settings-daemon/gnome-settings-daemon-localeexec:
nohup /usr/lib/gnome-settings-daemon/gnome-settings-daemon --debug >/tmp/gnome-settings-daemon.log 2>&1 &
in order to capture the process output