How does the GDM facilitate the Login of Ubuntu 18.04?

Asked by SunBear

I am would like to understand the login processes of Ubuntu 18.04. Can you help me?

After some research, I think the following processes are taking place:

During boot, the `/lib/systemd/system/gdm.service` will do the following:

1. Start the `systemd-user-sessions.service` to allow user logins after boot. This is because the files `/var/run/nologin` or `/etc/nologin` do not exists.

2. Start `/usr/sbin/gdm3`.

The main Greeter functions of the binary `/usr/sbin/gdm3` are to:

1. Facilitate User Login.

1.1 First, it involves starting up a special session of the GNOME Shell to run as either a Wayland compositor, and thus not use X at all, or run as an X window manager, and thus run the X server. I think Ubuntu 18.04 defaults to using X window manager given that [Ubuntu's Manpage on gdm3](http://manpages.ubuntu.com/manpages/bionic/man8/gdm3.8.html) describes that the gdm3 will execute the bash script `/etc/gdm3/Init/Default` prior to the Login stage. Reviewing this bash script, I saw that it is only used to set the X server's resource database, modifying keymaps and pointer button mappings in X, set the keyboard using the X Keyboard Extension.

1.2 Next, it involves showing GNOME's 2 Login GUIs. Firstly, a screen to choose a User (as is shown in https://2.bp.blogspot.com/-_8kJ8k3wFRg/XBOpSdWKqyI/AAAAAAAACD4/BHYm4ZcW0Sk4_ne7klH0hqWwV7rV1PKCgCLcBGAs/s640/display-manager-gdm3.png) appears. Subsequently, there appears another screen to fill in the User's password and to select the type GNOME Session that is to be used to create the User's Desktop environment in (as is shown in https://storage.googleapis.com/ubuntu-18/images/ubuntu-cinnamon-login.jpg).

2. Create User's Session After Login.

2.1 First, the bash script `/etc/gdm3/PreSession/Default` is used to update the user's environment's PATH variable.

2.2 Next, create a ubuntu session on the X server for the User. This is because by default "Ubuntu" is selected in the Login Screen (see the dropdown menu by pressing the "Gear" button on the left of the "Unlock" button in the Login Screen). gdm3 will activate the configuration file `/usr/share/xsessions/ubuntu.desktop`. Essentially, this file sets the environment variable `GNOME_SHELL_SESSION_MODE=ubuntu` and runs the binary `/usr/bin/gnome-session --session=ubuntu`. The latter creates the ubuntu session according to the instruction given in the file`/usr/share/gnome-session/sessions/ubuntu.session`. That is, the following application's `.desktop` files are placed into the Autostart directory called `/etc/xdg/autostart/` and these applications are launched automatically.

Required Components Application's `.desktop` file
=================== =============================
org.gnome.Shell; /usr/share/applications/org.gnome.Shell.desktop
org.gnome.SettingsDaemon.A11ySettings; /etc/xdg/autostart/org.gnome.SettingsDaemon.A11ySettings.desktop
org.gnome.SettingsDaemon.Clipboard; /etc/xdg/autostart/org.gnome.SettingsDaemon.Clipboard.desktop
org.gnome.SettingsDaemon.Color; /etc/xdg/autostart/org.gnome.SettingsDaemon.Color.desktop
org.gnome.SettingsDaemon.Datetime; /etc/xdg/autostart/org.gnome.SettingsDaemon.Datetime.desktop
org.gnome.SettingsDaemon.Housekeeping; /etc/xdg/autostart/org.gnome.SettingsDaemon.Housekeeping.desktop
org.gnome.SettingsDaemon.Keyboard; /etc/xdg/autostart/org.gnome.SettingsDaemon.Keyboard.desktop
org.gnome.SettingsDaemon.MediaKeys; /etc/xdg/autostart/org.gnome.SettingsDaemon.MediaKeys.desktop
org.gnome.SettingsDaemon.Mouse; /etc/xdg/autostart/org.gnome.SettingsDaemon.Mouse.desktop
org.gnome.SettingsDaemon.Power; /etc/xdg/autostart/org.gnome.SettingsDaemon.Power.desktop
org.gnome.SettingsDaemon.PrintNotifications; /etc/xdg/autostart/org.gnome.SettingsDaemon.PrintNotifications.desktop
org.gnome.SettingsDaemon.Rfkill; /etc/xdg/autostart/org.gnome.SettingsDaemon.Rfkill.desktop
org.gnome.SettingsDaemon.ScreensaverProxy; /etc/xdg/autostart/org.gnome.SettingsDaemon.ScreensaverProxy.desktop
org.gnome.SettingsDaemon.Sharing; /etc/xdg/autostart/org.gnome.SettingsDaemon.Sharing.desktop
org.gnome.SettingsDaemon.Smartcard; /etc/xdg/autostart/org.gnome.SettingsDaemon.Smartcard.desktop
org.gnome.SettingsDaemon.Sound; /etc/xdg/autostart/org.gnome.SettingsDaemon.Sound.desktop
org.gnome.SettingsDaemon.Wacom; /etc/xdg/autostart/org.gnome.SettingsDaemon.Wacom.desktop
org.gnome.SettingsDaemon.XSettings; /etc/xdg/autostart/org.gnome.SettingsDaemon.XSettings.desktop

At this stage, the complete GNOME 3 Shell is launched.

Please can you confirm if my descriptions are correct or not? If incorrect, kindly correct my erroneous view(s)? Thank you.

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu gdm3 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.