Untangling the mess that gui startup has become
psusi at ubuntu.com
Tue Sep 11 19:33:11 UTC 2018
Resending this after subscribing since after waiting for 3 weeks, no
moderator has released it.
Things used to be fairly simple. You ran startx, and it followed
~/.xinitrc which directed it to pick a display number and run XFree86 on
that display number, configure it to use an XAUTHORITY file, set the
environment variables to point to that display and XAUTHORITY file, then
run your window manager and shell ( which were actually separate things ).
Fast forward 25 years and now it looks like you have a display manager (
gdm3 or lightdm ). It looks like gdm3 looks in /etc/gdm3/custom.conf,
where you can tweak things but by default, it doesn't say much and gdm3
defaults to running gdm-x-session, which has no man page. It looks like
it is a clone of gnome-session ( why not just use gnome-session? ) It
apparently sets up XAUTHORITY and runs Xorg and tells it which display
and XAUTHORITY file to use. At this point under lightdm I think there
were some config files that direct it to run unity-greeter to prompt you
to login, but it looks like gnome-shell is being run on vt1 and it must
have a built in greeter function, in addition to being a shell and
window manager. After logging in, gdm3 appears to fork
gdm-session-worker ( no man page ) on the next unused vt. It runs
gnome-session-binary ( whose man page appears to be just gnome-session
). It is directed to set up a specific type of session chosen at the
greeter or defaulted, and how to setup these sessions is defined in
files in /usr/share/gnome-session/sessions. These files seem to list a
bunch of DBUS names so unlike other kinds of session files used by other
display managers that just tell them what programs to launch,
gnome-session must somehow punt to DBUS to launch them. Though oddly,
it appears that gnome-shell is forked from gdm-session-worker rather
than the dbus daemon. That is then both your window manager and shell.
Now for some reason, the gnome-shell greeter does not appear to give you
any choice in what login session you get ( why? ), but lightdm does, so
there you can choose to log in using a wayland session, and it goes
through an entirely different set of config files that end up directing
it to just run gnome-shell, which now besides being a shell and window
manager, is also a wayland compositor, replacing Xorg. gnome-shell
appears to automatically fork Xwayland, and forgets to setup an
XAUTHORITY for it.
A few months ago gdm did give you a choice to log in with wayland and
iirc from running it and looking at its code, it decided to run
gnome-shell and Xwayland. I guess gnome-shell notices if Xwayland was
already running and wouldn't fork one itself if so.
Do I have that about right and can anyone fill in the missing pieces?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 473 bytes
Desc: OpenPGP digital signature
More information about the ubuntu-desktop