Purpose of /etc/X11/Xsession.d files
I'm with linux and have some questions about Xsession. As I understand /etc/X11/Xsession script is launched when X Window System session is begun. But as I was examining code in /etc/X11/Xsession.d I got little confused. Scripts here are launched in order, 99x11-common_start is last one which contains exec $STARTUP I logged this variable and its just init --user. So it turns out that whole this script is written to just launch init --user? I deleted some files and logged in with different user and everything worked well, (for example 75dbus_dbus-launch). Does it mean that Xsession only launches init --user? What about session dbus, who launches it? thanks.
1 Answer
There is two DBus daemon launched at boot: --session & --system. The one in Xsession is session bus (user owns it).
~$ ps aux | grep dbus-daemon
message+ 944 0.0 0.0 44504 5640 ? Ss 07:55 0:01 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
sneetsh+ 2428 0.0 0.0 43864 4340 ? Ss 07:56 0:00 dbus-daemon --fork --session --address=unix:abstract=/tmp/dbus-xcqH0l6FdF
sneetsh+ 2522 0.0 0.0 43028 3932 ? S 07:56 0:00 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
sneetsh+ 4593 0.0 0.0 14328 964 pts/19 S+ 08:17 0:00 grep --color=auto dbus-daemonThe above output was from Ubuntu 16.04 and uses systemd.
System bus is launched by
systemd~$ service dbus status ● dbus.service - D-Bus System Message Bus Loaded: loaded (/lib/systemd/system/dbus.service; static; vendor preset: enabled) Active: active (running) since Wed 2016-07-06 07:55:13 CET; 27min ago Docs: man:dbus-daemon(1) Main PID: 944 (dbus-daemon) Tasks: 1 Memory: 3.5M CPU: 1.574s CGroup: / └─944 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activationSession bus is launched by
upstart~$ initctl status dbus dbus start/running, process 2428 ~$ initctl show-config dbus dbus start on starting xsession-init(Be aware this session upstart daemon, NOT init/system upstart one)
Ubuntu before 15.10 uses upstart init.
You can verify these using pstree -up. Another, way you may log DBUS_SESSION_BUS_ADDRESS variable from the file you have removed like you did with STARTUP.