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

display-manager: fix argument handling of sddm #23264

Closed
wants to merge 1 commit into from
Closed

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Feb 28, 2017

Motivation for this change

previously session type was not correctly set.
Currently only tested with session type 'none + awesome wm' and ssdm.
Other combinations should be handled in the same way, but for
critical components like login manager, be better safe then sorry

  • so please test this with your setup.

TODO:

  • run integration tests
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

previously session type was not correctly set
@Mic92 Mic92 added 2.status: work-in-progress 9.needs: port to stable A PR needs a backport to the stable release. labels Feb 28, 2017
@mention-bot
Copy link

@Mic92, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @rickynils and @nbp to be potential reviewers.

@grahamc
Copy link
Member

grahamc commented Mar 6, 2017

Still a WIP?

@grahamc grahamc closed this Mar 6, 2017
@grahamc grahamc reopened this Mar 6, 2017
Mic92 referenced this pull request Apr 7, 2017
For whatever reason, the OCR code is not detecting ALICE but is BOB.

OCR output from login screen (blank lines omitted):

> Session none + icewm
> 08:41 <
> Thursday, April 6, 2017
> BOB FOOBAR
> Select your user and enter password
@ghost ghost mentioned this pull request Apr 14, 2017
Copy link
Member

@primeos primeos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great & thanks for the explanation 😄

I've successfully tested this with the following:

  • 'none + i3'
  • 'xterm + i3'
  • 'xterm'

And the patch looks fine as well. I would suggest to merge this ASAP.

@@ -32,8 +32,14 @@ let
''
#! ${pkgs.bash}/bin/bash

# Handle being called by SDDM.
if test "''${1:0:1}" = / ; then eval exec $1 $2 ; fi
# SSDM splits "Exec" line in .desktop file by whitespace and pass script path as $1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/SSDM/SDDM/

@Mic92 Mic92 closed this in 6b7c5ba Apr 17, 2017
@Mic92 Mic92 deleted the sddm branch April 17, 2017 23:42
Mic92 added a commit that referenced this pull request Apr 17, 2017
previously session type was not correctly set.

fixes #23264

(cherry picked from commit 6b7c5ba)
edolstra added a commit that referenced this pull request Apr 22, 2017
This reverts commit 40a5498.

It breaks slim:

Apr 22 21:04:23 hagbard xsession[1037]: /nix/store/bw00yl4yspl3wlyiwk56bi0hljjr00di-xsession: Window manager '/nix/store/bw00yl4yspl3wlyiwk56bi0hljjr00di-xsession 'xfce'' not found.
Apr 22 21:04:23 hagbard xsession[1037]: /nix/store/bw00yl4yspl3wlyiwk56bi0hljjr00di-xsession: Desktop manager '/nix/store/bw00yl4yspl3wlyiwk56bi0hljjr00di-xsession 'xfce'' not found.

Issue #23264.
@edolstra
Copy link
Member

I reverted this on the 17.03 branch because it breaks slim: 99dfb6d.

@primeos
Copy link
Member

primeos commented Apr 22, 2017

@edolstra That's unfortunate... Does it break slim on the master branch as well (IIRC slim doesn't get any updates anymore)? And do we know the exact xsession parameters when called from slim?

Regarding my setup: For some very strange reason SDDM stopped providing any parameters (only $0 (obviously)) when calling the xsession script. I have no idea how this could happen (I don't remember changing my configuration or nixpkgs).

In order to see the parameters I've inserted:

      >&2 echo "xsession-parameter:"
      >&2 echo "$0"
      while [ $# -ge 1 ]; do
        >&2 echo "$1"
        shift
      done
      >&2 echo "xsession-parameter(end)"

At the following file: nixos/modules/services/x11/display-managers/default.nix
Directly after the following lines:

  # file provided by services.xserver.displayManager.session.script
  xsession = wm: dm: pkgs.writeScript "xsession"
    ''
      #! ${pkgs.bash}/bin/bash

Output from journalctl --boot:

-- Logs begin at Wed 2017-03-29 23:25:46 CEST, end at Sat 2017-04-22 23:23:56 CEST. --
[...]
Apr 22 23:23:39 localhost sddm-greeter[958]: Reading from "/nix/store/9bffhwsxn58k0rkj7idny1b66yci69sx-desktops/none + i3.desktop"
Apr 22 23:23:39 localhost sddm[937]: Message received from greeter: Login
Apr 22 23:23:39 localhost sddm[937]: Reading from "/nix/store/9bffhwsxn58k0rkj7idny1b66yci69sx-desktops/none + i3.desktop"
Apr 22 23:23:39 localhost sddm[937]: Reading from "/nix/store/9bffhwsxn58k0rkj7idny1b66yci69sx-desktops/none + i3.desktop"
Apr 22 23:23:39 localhost sddm[937]: Session "/nix/store/9bffhwsxn58k0rkj7idny1b66yci69sx-desktops/none + i3.desktop" selected, command: "/nix/store/465cd4i3w615vbhznpl4pv3c2hmpa1ab-xsession 'none + i3'"
Apr 22 23:23:39 localhost sddm-helper[1000]: [PAM] Starting...
Apr 22 23:23:39 localhost sddm-helper[1000]: [PAM] Authenticating...
Apr 22 23:23:39 localhost sddm-helper[1000]: [PAM] Preparing to converse...
Apr 22 23:23:39 localhost sddm-helper[1000]: [PAM] Conversation with 1 messages
Apr 22 23:23:39 localhost sddm-helper[1000]: [PAM] returning.
Apr 22 23:23:39 localhost sddm[937]: Authenticated successfully
Apr 22 23:23:39 localhost sddm-greeter[958]: Message received from daemon: LoginSucceeded
Apr 22 23:23:39 localhost sddm-helper[1000]: pam_unix(sddm:session): session opened for user john by (uid=0)
Apr 22 23:23:39 localhost systemd[1]: Created slice User Slice of john.
Apr 22 23:23:39 localhost systemd[1]: Starting User Manager for UID 1001...
Apr 22 23:23:39 localhost systemd[1001]: pam_unix(systemd-user:session): session opened for user john by (uid=0)
Apr 22 23:23:39 localhost systemd-logind[920]: New session 2 of user john.
Apr 22 23:23:39 localhost systemd[1]: Started Session 2 of user john.
Apr 22 23:23:39 localhost sddm-helper[948]: [PAM] Closing session
Apr 22 23:23:39 localhost sddm-helper[948]: [PAM] Ended.
Apr 22 23:23:39 localhost sddm[937]: Auth: sddm-helper exited successfully
Apr 22 23:23:39 localhost sddm[937]: Greeter stopped.
Apr 22 23:23:39 localhost systemd[1001]: Reached target Timers.
Apr 22 23:23:39 localhost systemd[1001]: Reached target Sockets.
Apr 22 23:23:39 localhost systemd[1001]: Reached target Paths.
Apr 22 23:23:39 localhost xsession[1009]: xsession-parameter:
Apr 22 23:23:39 localhost xsession[1009]: /nix/store/465cd4i3w615vbhznpl4pv3c2hmpa1ab-xsession
Apr 22 23:23:39 localhost xsession[1009]: xsession-parameter(end)
Apr 22 23:23:39 localhost systemd[1001]: Reached target Basic System.
Apr 22 23:23:39 localhost systemd[1001]: Starting SSH Agent...
Apr 22 23:23:39 localhost systemd[1001]: Started SSH Agent.
Apr 22 23:23:39 localhost systemd[1001]: Reached target Default.
Apr 22 23:23:39 localhost systemd[1001]: Startup finished in 10ms.
Apr 22 23:23:39 localhost systemd[1]: Started User Manager for UID 1001.
Apr 22 23:23:39 localhost sddm-helper[1000]: Starting: "/nix/store/465cd4i3w615vbhznpl4pv3c2hmpa1ab-xsession /nix/store/465cd4i3w615vbhznpl4pv3c2hmpa1ab-xsession 'none + i3'"
Apr 22 23:23:39 localhost sddm-helper[1009]: Adding cookie to "/home/john/.Xauthority"
Apr 22 23:23:39 localhost sddm[937]: Session started
Apr 22 23:23:39 localhost xsession[1009]: xsession-parameter:
Apr 22 23:23:39 localhost xsession[1009]: /nix/store/465cd4i3w615vbhznpl4pv3c2hmpa1ab-xsession
Apr 22 23:23:39 localhost xsession[1009]: xsession-parameter(end)
[...]

But it looks like the script should've been called with parameters: command: "/nix/store/465cd4i3w615vbhznpl4pv3c2hmpa1ab-xsession 'none + i3'"

primeos added a commit that referenced this pull request Apr 23, 2017
This reverts commit 6b7c5ba.

Unfortunately it seems like this broke slim, lightdm and gdm (see #25068
and #23264). This is already reverted in the 17.03 branch (99dfb6d).

TODO: We need tests for slim and lightdm and fix the test for gdm
(failing since 2016-10-26) to prevent such breakage in the future.
@primeos
Copy link
Member

primeos commented Apr 23, 2017

I just noticed that we're actually using the wrong quoting within our desktop entry files.

#25138 should fix that (but in order to test this I need to fix my other bug first). This might fix this SDDM issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9.needs: port to stable A PR needs a backport to the stable release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants