Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdm doesn't show a session chooser #34101

Closed
steveej opened this issue Jan 21, 2018 · 4 comments
Closed

gdm doesn't show a session chooser #34101

steveej opened this issue Jan 21, 2018 · 4 comments
Labels
0.kind: bug 6.topic: GNOME GNOME desktop environment and its underlying platform

Comments

@steveej
Copy link
Contributor

steveej commented Jan 21, 2018

Steps to reproduce

In the NixOS configuration.nix enable two desktops and gdm, e.g.

    desktopManager = {
      gnome3.enable = true;
      xterm.enable = true;
      plasma5.enable = false;
    };

    displayManager = {
      gdm.enable = true;
      gdm.wayland = false; #not sure if this is important but I don't use wayland
    };
  };

Boot the system to gdm and note that there is not way of choosing the session.
I'd expect there to be a button that allows to choose the session used for the next login.

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.14.14, NixOS, 17.09.2823.fd0abdcebc1 (Hummingbird)
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 1.11.16
  • channels(root): "nixos-unstable-18.03pre125750.a6dca042722, nixos-17.09.2823.fd0abdcebc1"
  • channels(steveej): ""
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
@steveej
Copy link
Contributor Author

steveej commented Jan 21, 2018

It looks like the patch we're using to modify the session lookup path is not working as expected.
I have verified this by testing the default paths with an ugly activationScripts hack in my configuration:

  system.activationScripts.etcX11sessinos = ''
    echo "setting up /etc/X11/sessions..."
    mkdir -p /etc/X11
    [[ ! -L /etc/X11/sessions ]] || rm /etc/X11/sessions
    ln -sf ${config.services.xserver.displayManager.session.desktops} /etc/X11/sessions
  '';

This allows gdm to find the installed desktop sessions.

/cc @jtojnar

@jtojnar jtojnar added 0.kind: bug 6.topic: GNOME GNOME desktop environment and its underlying platform labels Jan 21, 2018
@jtojnar
Copy link
Member

jtojnar commented Jan 21, 2018

The environment is defnitely read, I patched gdm to print it and it does:

Without your activation script
Jan 21 16:59:10 nixos gdm[757]: GdmManager: trying to open reauthentication channel for user j
Jan 21 16:59:10 nixos gdm[757]: GdmSession: starting conversation gdm-password
Jan 21 16:59:10 nixos gdm[757]: GdmSessionWorkerJob: Starting worker...
Jan 21 16:59:10 nixos gdm[757]: GdmSessionWorkerJob: Running session_worker_job process: gdm-session-worker [pam/gdm-password] /nix/store/vqj7zc9pmigaaigdz1h9b2q17xm4bbij-gdm-3.26.2.1/libexec/gdm-session-worker
Jan 21 16:59:10 nixos gdm[757]: GdmSessionWorkerJob: : SessionWorkerJob on pid 1064
Jan 21 16:59:10 nixos gdm-password][1064]: Enabling debugging
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionWorker: connecting to address: unix:abstract=/tmp/dbus-2e6iaMcO
Jan 21 16:59:10 nixos gdm[757]: GdmDBusServer: new connection 0x20fe880
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Handling new connection from worker
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Authenticating new connection
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: calling 'ListCachedUsers'
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: Failed to identify the current session: No data available
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: seat unloaded, so trying to set loaded property
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: Listing cached users, so not setting loaded property
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: Listing cached users, so not setting loaded property
Jan 21 16:59:10 nixos gdm[757]: GdmSession: worker connection is 0x20fe880
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Emitting conversation-started signal
Jan 21 16:59:10 nixos gdm[757]: GdmManager: session conversation started for service gdm-password
Jan 21 16:59:10 nixos gdm[757]: GdmSession: getting session command for file 'gnome.desktop'
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: ListCachedUsers finished, will set loaded property after list is fully loaded
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: tracking new user with object path /org/freedesktop/Accounts/User1000
Jan 21 16:59:10 nixos gdm[757]: GdmSession: File 'gnome.desktop' not found: Valid key file could not be found in search dirs
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 16:59:10 nixos gdm[757]: GdmSession: getting session command for file 'plasma5.desktop'
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: unrefing manager owned by finished ListCachedUsers call
Jan 21 16:59:10 nixos gdm[757]: GdmSession: getting session command for file 'gnome3.desktop'
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: user j is now loaded
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: user j was not yet known, adding it
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: tracking user 'j'
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: not yet loaded, so not emitting user-added signal
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: no pending users, trying to set loaded property
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: Seat wouldn't load, so giving up on it and setting loaded property
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: sending user-changed signal for user j
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: sent user-changed signal for user j
Jan 21 16:59:10 nixos gdm-password][1064]: AccountsService: ActUserManager: updating user j
Jan 21 16:59:10 nixos gdm[757]: GdmSession: getting session command for file 'xterm.desktop'
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 16:59:10 nixos gdm[757]: GdmSession: checking if file 'gnome3.desktop' is wayland session: no
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Setting user: 'j'
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Beginning initialization
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Conversation started
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionSettings: saved session is
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionWorker: Saved session is
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionSettings: saved language is
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionWorker: Saved language is
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionWorker: attempting to change state to SETUP_COMPLETE
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionWorker: initializing PAM; service=gdm-password username=j seat=seat0
Jan 21 16:59:10 nixos gdm[757]: GdmSession: getting session command for file '.desktop'
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 16:59:10 nixos gdm[757]: GdmSession: File '.desktop' not found: Valid key file could not be found in search dirs
Jan 21 16:59:10 nixos gdm[757]: GdmSession: not using invalid .dmrc session:
Jan 21 16:59:10 nixos gdm[757]: GdmSession: getting session command for file 'gnome3.desktop'
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 16:59:10 nixos gdm[757]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 16:59:10 nixos gdm[757]: GdmSession: checking if file 'gnome3.desktop' is wayland session: no
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionWorker: Set PAM environment variable: 'XDG_SEAT=seat0'
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionWorker: state SETUP_COMPLETE
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionWorker: attempting to change state to AUTHENTICATED
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionWorker: authenticating user j
Jan 21 16:59:10 nixos gdm-password][1064]: gkr-pam: no password is available for user
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionWorker: 1 new messages received from PAM
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionWorker: username is 'j'
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionWorker: old-username='j' new-username='j'
Jan 21 16:59:10 nixos gdm-password][1064]: GdmSessionWorker: received pam message of type 1 with payload 'Password: '
With your activation script
Jan 21 17:10:32 nixos gdm[754]: GdmManager: trying to open reauthentication channel for user j
Jan 21 17:10:32 nixos gdm[754]: GdmSession: starting conversation gdm-password
Jan 21 17:10:32 nixos gdm[754]: GdmSessionWorkerJob: Starting worker...
Jan 21 17:10:32 nixos gdm[754]: GdmSessionWorkerJob: Running session_worker_job process: gdm-session-worker [pam/gdm-password] /nix/store/vqj7zc9pmigaaigdz1h9b2q17xm4bbij-gdm-3.26.2.1/libexec/gdm-session-worker
Jan 21 17:10:32 nixos gdm[754]: GdmSessionWorkerJob: : SessionWorkerJob on pid 1058
Jan 21 17:10:32 nixos gdm-password][1058]: Enabling debugging
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionWorker: connecting to address: unix:abstract=/tmp/dbus-oN4SwXo2
Jan 21 17:10:32 nixos gdm[754]: GdmDBusServer: new connection 0x23cf880
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Handling new connection from worker
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Authenticating new connection
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: calling 'ListCachedUsers'
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: Failed to identify the current session: No data available
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: seat unloaded, so trying to set loaded property
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: Listing cached users, so not setting loaded property
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: Listing cached users, so not setting loaded property
Jan 21 17:10:32 nixos gdm[754]: GdmSession: worker connection is 0x23cf880
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Emitting conversation-started signal
Jan 21 17:10:32 nixos gdm[754]: GdmManager: session conversation started for service gdm-password
Jan 21 17:10:32 nixos gdm[754]: GdmSession: getting session command for file 'gnome.desktop'
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: ListCachedUsers finished, will set loaded property after list is fully loaded
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: tracking new user with object path /org/freedesktop/Accounts/User1000
Jan 21 17:10:32 nixos gdm[754]: GdmSession: File 'gnome.desktop' not found: Valid key file could not be found in search dirs
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 17:10:32 nixos gdm[754]: GdmSession: getting session command for file 'plasma5.desktop'
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 17:10:32 nixos gdm[754]: GdmSession: getting session command for file 'gnome3.desktop'
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 17:10:32 nixos gdm[754]: GdmSession: getting session command for file 'xterm.desktop'
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: unrefing manager owned by finished ListCachedUsers call
Jan 21 17:10:32 nixos gdm[754]: GdmSession: getting session command for file 'plasma5.desktop'
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 17:10:32 nixos gdm[754]: GdmSession: getting session command for file 'gnome3.desktop'
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: user j is now loaded
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: user j was not yet known, adding it
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: tracking user 'j'
Jan 21 17:10:32 nixos gdm[754]: GdmSession: getting session command for file 'xterm.desktop'
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: not yet loaded, so not emitting user-added signal
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: no pending users, trying to set loaded property
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: Seat wouldn't load, so giving up on it and setting loaded property
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: sending user-changed signal for user j
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: sent user-changed signal for user j
Jan 21 17:10:32 nixos gdm-password][1058]: AccountsService: ActUserManager: updating user j
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 17:10:32 nixos gdm[754]: GdmSession: checking if file 'gnome3.desktop' is wayland session: no
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Setting user: 'j'
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Beginning initialization
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Conversation started
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionSettings: saved session is
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionWorker: Saved session is
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionSettings: saved language is
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionWorker: Saved language is
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionWorker: attempting to change state to SETUP_COMPLETE
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionWorker: initializing PAM; service=gdm-password username=j seat=seat0
Jan 21 17:10:32 nixos gdm[754]: GdmSession: getting session command for file '.desktop'
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 17:10:32 nixos gdm[754]: GdmSession: File '.desktop' not found: Valid key file could not be found in search dirs
Jan 21 17:10:32 nixos gdm[754]: GdmSession: not using invalid .dmrc session:
Jan 21 17:10:32 nixos gdm[754]: GdmSession: getting session command for file 'gnome3.desktop'
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 17:10:32 nixos gdm[754]: GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops
Jan 21 17:10:32 nixos gdm[754]: GdmSession: checking if file 'gnome3.desktop' is wayland session: no
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionWorker: Set PAM environment variable: 'XDG_SEAT=seat0'
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionWorker: state SETUP_COMPLETE
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionWorker: attempting to change state to AUTHENTICATED
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionWorker: authenticating user j
Jan 21 17:10:32 nixos gdm-password][1058]: gkr-pam: no password is available for user
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionWorker: 1 new messages received from PAM
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionWorker: username is 'j'
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionWorker: old-username='j' new-username='j'
Jan 21 17:10:32 nixos gdm-password][1058]: GdmSessionWorker: received pam message of type 1 with payload 'Password: '

The only difference seems to be a missing slash in the environment variable but adding it does not help:

With a trailing slash
GdmManager: trying to open reauthentication channel for user j
GdmSession: starting conversation gdm-password
GdmSessionWorkerJob: Starting worker...
GdmSessionWorkerJob: Running session_worker_job process: gdm-session-worker [pam/gdm-password] /nix/store/vqj7zc9pmigaaigdz1h9b2q17xm4bbij-gdm-3.26.2.1/libexec/gdm-session-worker
GdmSessionWorkerJob: : SessionWorkerJob on pid 1071
Enabling debugging
GdmSessionWorker: connecting to address: unix:abstract=/tmp/dbus-q6hR5s3C
GdmDBusServer: new connection 0x20b1880
GdmSession: Handling new connection from worker
GdmSession: Authenticating new connection
AccountsService: ActUserManager: calling 'ListCachedUsers'
AccountsService: Failed to identify the current session: No data available
AccountsService: ActUserManager: seat unloaded, so trying to set loaded property
AccountsService: ActUserManager: Listing cached users, so not setting loaded property
AccountsService: ActUserManager: Listing cached users, so not setting loaded property
GdmSession: worker connection is 0x20b1880
GdmSession: Emitting conversation-started signal
GdmManager: session conversation started for service gdm-password
GdmSession: getting session command for file 'gnome.desktop'
GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops/
AccountsService: ActUserManager: ListCachedUsers finished, will set loaded property after list is fully loaded
AccountsService: ActUserManager: tracking new user with object path /org/freedesktop/Accounts/User1000
GdmSession: File 'gnome.desktop' not found: Valid key file could not be found in search dirs
GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops/
GdmSession: getting session command for file 'plasma5.desktop'
GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops/
GdmSession: getting session command for file 'gnome3.desktop'
GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops/
AccountsService: ActUserManager: unrefing manager owned by finished ListCachedUsers call
AccountsService: ActUserManager: user j is now loaded
AccountsService: ActUserManager: user j was not yet known, adding it
AccountsService: ActUserManager: tracking user 'j'
AccountsService: ActUserManager: not yet loaded, so not emitting user-added signal
GdmSession: getting session command for file 'xterm.desktop'
GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops/
AccountsService: ActUserManager: no pending users, trying to set loaded property
AccountsService: ActUserManager: Seat wouldn't load, so giving up on it and setting loaded property
AccountsService: ActUserManager: sending user-changed signal for user j
AccountsService: ActUserManager: sent user-changed signal for user j
AccountsService: ActUserManager: updating user j
GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops/
GdmSession: checking if file 'gnome3.desktop' is wayland session: no
GdmSession: Setting user: 'j'
GdmSession: Beginning initialization
GdmSession: Conversation started
GdmSessionSettings: saved session is
GdmSessionWorker: Saved session is
GdmSessionSettings: saved language is
GdmSessionWorker: Saved language is
GdmSessionWorker: attempting to change state to SETUP_COMPLETE
GdmSessionWorker: initializing PAM; service=gdm-password username=j seat=seat0
GdmSession: getting session command for file '.desktop'
GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops/
GdmSession: File '.desktop' not found: Valid key file could not be found in search dirs
GdmSession: not using invalid .dmrc session:
GdmSession: getting session command for file 'gnome3.desktop'
GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops/
GdmSession: Content of GDM_SESSIONS_DIR: /nix/store/6wirfciqjs9ccl5wg48sd4j2r4xqq01k-desktops/
GdmSession: checking if file 'gnome3.desktop' is wayland session: no
GdmSessionWorker: Set PAM environment variable: 'XDG_SEAT=seat0'
GdmSessionWorker: state SETUP_COMPLETE
GdmSessionWorker: attempting to change state to AUTHENTICATED
GdmSessionWorker: authenticating user j
gkr-pam: no password is available for user
GdmSessionWorker: 1 new messages received from PAM
GdmSessionWorker: username is 'j'
GdmSessionWorker: old-username='j' new-username='j'
GdmSessionWorker: received pam message of type 1 with payload 'Password: '

zemm added a commit to zemm/nix-files that referenced this issue Mar 1, 2018
Gdm session list was not showing up, so needed a dirty fix
NixOS/nixpkgs#34101
@jtojnar
Copy link
Member

jtojnar commented May 2, 2018

Okay, so the current GDM patch only fixes the code starting a session. GDM somehow starts GNOME Shell as a greeter, which uses libgdm to get list of the sessions. We need to add the following patch:

--- a/libgdm/gdm-sessions.c
+++ b/libgdm/gdm-sessions.c
@@ -217,6 +217,7 @@
 {
         int         i;
         const char *xorg_search_dirs[] = {
+                "/var/empty/",
                 "/etc/X11/sessions/",
                 DMCONFDIR "/Sessions/",
                 DATADIR "/gdm/BuiltInSessions/",
@@ -224,6 +225,10 @@
                 NULL
         };
 
+        if (g_getenv("GDM_SESSIONS_DIR") != NULL) {
+                xorg_search_dirs[0] = g_getenv("GDM_SESSIONS_DIR");
+        };
+
 #ifdef ENABLE_WAYLAND_SUPPORT
         const char *wayland_search_dirs[] = {
                 DATADIR "/wayland-sessions/",

That is not enough, though, since GDM does not seem to pass the GDM_SESSIONS_DIR variable to the greeter.

@jtojnar
Copy link
Member

jtojnar commented May 2, 2018

Okay, I have fixed the issue in #39615:

screenshot from 2018-05-02 04-39-03

In the future, we might want to use upstream session desktop files. The following GDM patch will be needed:

--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -343,6 +343,8 @@
 {
         GArray *search_array = NULL;
         char **search_dirs;
+        int i;
+        const gchar * const *system_data_dirs = g_get_system_data_dirs ();
 
         static const char *x_search_dirs[] = {
                 "/etc/X11/sessions/",
@@ -357,12 +359,27 @@
 
         g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
 
+        for (i = 0; system_data_dirs[i]; i++) {
+                gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
+                g_array_insert_val (search_array, i, dir);
+        }
+
 #ifdef ENABLE_WAYLAND_SUPPORT
         if (!self->priv->ignore_wayland) {
 #ifdef ENABLE_USER_DISPLAY_SERVER
                 g_array_prepend_val (search_array, wayland_search_dir);
+
+                for (i = 0; system_data_dirs[i]; i++) {
+                        gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
+                        g_array_insert_val (search_array, i, dir);
+                }
 #else
                 g_array_append_val (search_array, wayland_search_dir);
+
+                for (i = 0; system_data_dirs[i]; i++) {
+                        gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
+                        g_array_append_val (search_array, dir);
+                }
 #endif
         }
 #endif
--- a/libgdm/gdm-sessions.c
+++ b/libgdm/gdm-sessions.c
@@ -162,7 +162,7 @@
 }
 
 static void
-collect_sessions_from_directory (const char *dirname)
+collect_sessions_from_directory (const char *dirname, void *user_data)
 {
         GDir       *dir;
         const char *filename;
@@ -216,19 +216,30 @@
 collect_sessions (void)
 {
         int         i;
-        const char *xorg_search_dirs[] = {
-                "/etc/X11/sessions/",
-                DMCONFDIR "/Sessions/",
-                DATADIR "/gdm/BuiltInSessions/",
-                DATADIR "/xsessions/",
-                NULL
-        };
+        GPtrArray *xorg_search_dirs = g_ptr_array_new ();
+        const gchar * const *system_data_dirs = g_get_system_data_dirs ();
+
+        g_ptr_array_add (xorg_search_dirs, g_strdup ("/etc/X11/sessions/"));
+        g_ptr_array_add (xorg_search_dirs, g_strdup (DMCONFDIR "/Sessions/"));
+        g_ptr_array_add (xorg_search_dirs, g_strdup (DATADIR "/gdm/BuiltInSessions/"));
+        g_ptr_array_add (xorg_search_dirs, g_strdup (DATADIR "/xsessions/"));
+
+        for (i = 0; system_data_dirs[i]; i++) {
+                g_ptr_array_add (xorg_search_dirs, g_build_filename (system_data_dirs[i], "xsessions", NULL));
+        }
+
+        g_ptr_array_add (xorg_search_dirs, NULL);
 
 #ifdef ENABLE_WAYLAND_SUPPORT
-        const char *wayland_search_dirs[] = {
-                DATADIR "/wayland-sessions/",
-                NULL
-        };
+        GPtrArray *wayland_search_dirs = g_ptr_array_new ();
+
+        g_ptr_array_add (wayland_search_dirs, g_strdup (DATADIR "/wayland-sessions/"));
+
+        for (i = 0; system_data_dirs[i]; i++) {
+                g_ptr_array_add (wayland_search_dirs, g_build_filename (system_data_dirs[i], "wayland-sessions", NULL));
+        }
+
+        g_ptr_array_add (wayland_search_dirs, NULL);
 #endif
 
         if (gdm_available_sessions_map == NULL) {
@@ -236,9 +247,9 @@
                                                                     g_free, (GDestroyNotify)gdm_session_file_free);
         }
 
-        for (i = 0; xorg_search_dirs [i] != NULL; i++) {
-                collect_sessions_from_directory (xorg_search_dirs [i]);
-        }
+        g_ptr_array_foreach (xorg_search_dirs, (GFunc) collect_sessions_from_directory, NULL);
+
+        g_ptr_array_free (xorg_search_dirs, TRUE);
 
 #ifdef ENABLE_WAYLAND_SUPPORT
 #ifdef ENABLE_USER_DISPLAY_SERVER
@@ -247,9 +258,9 @@
         }
 #endif
 
-        for (i = 0; wayland_search_dirs [i] != NULL; i++) {
-                collect_sessions_from_directory (wayland_search_dirs [i]);
-        }
+        g_ptr_array_foreach (wayland_search_dirs, (GFunc) collect_sessions_from_directory, NULL);
+
+        g_ptr_array_free (wayland_search_dirs, TRUE);
 #endif
 }
 

jtojnar added a commit to jtojnar/nixpkgs that referenced this issue May 2, 2018
We are patching GDM to respect GDM_SESSIONS_DIR environment
variable, which we are setting in the GDM module. Previously, we
only took care of a single code path, the one that handled session
start-up; missing the one obtaining the list of sessions.

This commit patches the second code path, and also whitelists the
GDM_SESSIONS_DIR so that it can be passed to the greeter.

Fixes NixOS#34101
@jtojnar jtojnar closed this as completed in 300af66 May 6, 2018
thefloweringash pushed a commit to thefloweringash/nixpkgs that referenced this issue Aug 4, 2018
We are patching GDM to respect GDM_SESSIONS_DIR environment
variable, which we are setting in the GDM module. Previously, we
only took care of a single code path, the one that handled session
start-up; missing the one obtaining the list of sessions.

This commit patches the second code path, and also whitelists the
GDM_SESSIONS_DIR so that it can be passed to the greeter.

Fixes NixOS#34101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug 6.topic: GNOME GNOME desktop environment and its underlying platform
Projects
Status: Done
Development

No branches or pull requests

2 participants