What program starts dbus-daemon?

What program starts the per user session dbus-daemon process in GNOME 2 and GNOME 3 (presumably via dbus-launch)? I would like to know because I would like to add a directory to the list of directories that dbus-daemon checks for .service files.

(Obviously if it's a sh program, "sh" isn't the answer I'm looking for ;-)

How could I have answered this question for myself efficiently? What documentation is there on desktop and session startup?

3

3 Answers

The login manager starts dbus via the Xsession scripts directory. If the use-session-dbus option is set for the Xsession, then the dbus Xsession script is loaded, and it runs dbus-launch --exit-with-session $session_command.

7

Starting of the majority of tasks and services during boot including Dbus daemon is handled by Upstart.

Dbus daemon is not started per user session but on mounting the last local filesystem. Upstart job configuration handling starting/stopping/monitoring of Dbus daemon can be found in /etc/init/dbus.conf.

You can use user job to start Hamster on graphical login.

4

I will disagree with dobey. The best thing to do is to learn how to find it for yourself.

List all processes and their PID tree structure:

pstree
init─┬─ModemManager───2*[{ModemManager}] ├─NetworkManager─┬─2*[dhclient] │ ├─dnsmasq │ └─3*[{NetworkManager}] ├─accounts-daemon───2*[{accounts-daemon}] ├─acpid ├─avahi-daemon───avahi-daemon ├─bluetoothd ├─colord───2*[{colord}] ├─cron ├─cups-browsed ├─cupsd ├─dbus-daemon
....

So dbus-daemon is started by init. However notice that there is more than one dbus-daemon running.

manos@box:~$ ps aux | grep dbus-daemon
message+ 845 0.0 0.0 40668 2620 ? Ss 10:48 0:03 dbus-daemon --system --fork
manos 2480 0.0 0.0 40248 2428 ? Ss 10:48 0:01 dbus-daemon --fork --session --address=unix:abstract=/tmp/dbus-o3GMKn9JC1
manos 2569 0.0 0.0 39248 2004 ? S 10:48 0:00 /bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3

There are namely (at least) two instances of dbus-daemon running. One is started by init and it's system wide and the other is started for the user when he logged in. Watching the full PID tree structure (with pstree) you can visually locate exactly which process started the second instance.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like