Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sddm + wayland + systemd: Authentication problems? [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6385

PostPosted: Thu Sep 10, 2020 6:41 am    Post subject: sddm + wayland + systemd: Authentication problems? [solved] Reply with quote

Hello,

it seems that running wayland without (e)logind + pam is impossible, meanwhile. (Or does anybody know a way?) (Previously I was able to patch weston to run as root, but this doesn't work anymore for unknown reasons.)

It is also very unhappy that you cannot have systemd + elogind both installed, since prevoiusly I liked to switch booting between openrc and systemd to normally use openrc but have systemd as a recovery system if necessary.

So I bit the bullet and installed pam, enabling USE=pam in sddm, libcap, and systemd. USE=systemd is enabled almost everywhere (and thus no elogind, of course).

But starting wayland doesn't work. While X starts fine with the logs
journalctl -b --unit=sddm.service wrote:
sddm[1341]: Reading from "/usr/share/xsessions/fvwm-crystal.desktop"
sddm[1341]: Session "/usr/share/xsessions/fvwm-crystal.desktop" selected, command: "fvwm-crystal"
sddm[1341]: Adding cookie to "/var/run/sddm/{cff9fb53-313e-41c4-82d9-08c93a2200ae}"
sddm-helper[1750]: [PAM] Starting...
sddm-helper[1750]: [PAM] Authenticating...
sddm-helper[1750]: [PAM] returning.
sddm[1341]: Authenticated successfully
sddm-helper[1750]: Starting: "/home/gentoo/various/etc/X11/Xsession \"fvwm-crystal\""
sddm[1341]: Session started

(actually, I do not see the point of logind + pam here: I have X without suid bit, and it did run fine also without pam) (with loginctl, I can see that the user has some logind cookie), I get a different output if I attempt to run wayland (hikari or weston - both the same):
journalctl -b --unit=sddm.service wrote:
sddm[1341]: Reading from "/usr/share/wayland-sessions/weston.desktop"
sddm[1341]: Session "/usr/share/wayland-sessions/weston.desktop" selected, command: "weston"
sddm-helper[4221]: [PAM] Starting...
sddm-helper[4221]: [PAM] Authenticating...
sddm-helper[4221]: [PAM] Preparing to converse...
sddm-helper[4221]: [PAM] Conversation with 1 messages
sddm-helper[4221]: [PAM] returning.
sddm[1341]: Authenticated successfully
sddm[1341]: Jumping to VT 1
sddm[1341]: VT mode didn't need to be fixed
sddm-helper[4221]: Starting: "/home/gentoo/various/etc/X11/wayland-session weston"
sddm[1341]: Session started
sddm-helper[4221]: [PAM] Closing session
sddm-helper[4221]: [PAM] Ended.
sddm[1341]: Auth: sddm-helper exited with 1

Thus, although sddm claims that the authentication was successful, it apparently was not, because sddm-helper has some problem (for which I found no log). The picture of the greeter remains unchanged, and when running weston, I see
~logged_in_user/.local/share/sddm/wayland-session.log wrote:
[20:14:22.741] weston 9.0.0
https://wayland.freedesktop.org
Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
Build: 9.0.0
[20:14:22.742] Command line: weston
[20:14:22.742] OS: Linux, 5.8.7-gentoo, #2 SMP Sun Sep 6 13:54:30 CEST 2020, x86_64
[20:14:22.742] Starting with no config file.
[20:14:22.742] Output repaint window is 7 ms maximum.
[20:14:22.755] Loading module '/usr/lib64/libweston-9/drm-backend.so'
[20:14:22.757] initializing drm backend
[20:14:22.757] logind: not running in a systemd session
[20:14:22.757] logind: cannot setup systemd-logind helper (-3), using legacy fallback
[20:14:22.757] fatal: drm backend should be run using weston-launch binary, or your system should provide the logind D-Bus API.
[20:14:22.757] fatal: failed to create compositor backend
Internal warning: debug scope 'drm-backend' has not been destroyed.

When running hikari, this file is not generated. loginctl on some other terminal only outputs a 1-line error which I missed to save (I can do if you think that this information is important).

Why could the authentication fail? Experimentally, I tried to enable USE=pam also for util-linux, but this didn't help.


Last edited by mv on Sun Oct 25, 2020 6:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6385

PostPosted: Sun Oct 18, 2020 9:11 am    Post subject: Reply with quote

I tried now with weston, because this at least starts when called from a terminal as the root user. The entry I get when attempting to start it with sddm is:
~/.local/share/sddm wrote:

Date: 2020-10-18 CEST
[10:53:38.650] weston 9.0.0
https://wayland.freedesktop.org
Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
Build: 9.0.0
[10:53:38.650] Command line: weston
[10:53:38.650] OS: Linux, 5.9.0-gentoo, #2 SMP Sat Oct 17 20:56:13 CEST 2020, x86_64
[10:53:38.650] Starting with no config file.
[10:53:38.650] Output repaint window is 7 ms maximum.
[10:53:38.666] Loading module '/usr/lib64/libweston-9/drm-backend.so'
[10:53:38.669] initializing drm backend
[10:53:38.669] logind: not running in a systemd session
[10:53:38.669] logind: cannot setup systemd-logind helper (-3), using legacy fallback
[10:53:38.669] fatal: drm backend should be run using weston-launch binary, or your system should provide the logind D-Bus API.
[10:53:38.669] fatal: failed to create compositor backend

The problem always seems to be the missing logind registration. The full log when first running X (succesfully) and then weston is this:
journalctl -b --unit=sddm.service wrote:

systemd[1]: Started Simple Desktop Display Manager.
sddm[1284]: Initializing...
sddm[1284]: Starting...
sddm[1284]: Logind interface found
sddm[1284]: Adding new display on vt 7 ...
sddm[1284]: Loading theme configuration from ""
sddm[1284]: Display server starting...
sddm[1284]: Running: /usr/bin/X -nolisten tcp -iglx -auth /var/run/sddm/{756e83f3-70df-4899-9600-1ab56fb44361} -background none -noreset -displayfd 17 -seat seat0 vt7
sddm[1284]: Setting default cursor
sddm[1284]: Could not setup default cursor
sddm[1284]: Running display setup script "/home/gentoo/various/etc/X11/xsession.sddm"
sddm[1284]: Display server started.
sddm[1284]: Reading from "/usr/share/xsessions/fvwm-crystal.desktop"
sddm[1284]: Reading from "/usr/share/xsessions/fvwm-crystal.desktop"
sddm[1284]: Session "/usr/share/xsessions/fvwm-crystal.desktop" selected, command: "fvwm-crystal"
sddm[1284]: Adding cookie to "/var/run/sddm/{756e83f3-70df-4899-9600-1ab56fb44361}"
sddm-helper[1447]: [PAM] Starting...
sddm-helper[1447]: [PAM] Authenticating...
sddm-helper[1447]: [PAM] returning.
sddm[1284]: Authenticated successfully
sddm-helper[1447]: Starting: "/home/gentoo/various/etc/X11/Xsession \"fvwm-crystal\""
sddm[1284]: Session started
sddm[1284]: Auth: sddm-helper exited successfully
sddm[1284]: Display server stopping...
sddm[1284]: Display server stopped.
sddm[1284]: Running display stop script "/usr/share/sddm/scripts/Xstop"
sddm[1284]: Removing display ":0" ...
sddm[1284]: Adding new display on vt 7 ...
sddm[1284]: Loading theme configuration from ""
sddm[1284]: Display server starting...
sddm[1284]: Running: /usr/bin/X -nolisten tcp -iglx -auth /var/run/sddm/{a1798342-b4d3-43d0-be36-518d4c6117d8} -background none -noreset -displayfd 17 -seat seat0 vt7
sddm[1284]: Setting default cursor
sddm[1284]: Could not setup default cursor
sddm[1284]: Running display setup script "/home/gentoo/various/etc/X11/xsession.sddm"
sddm[1284]: Display server started.
sddm[1284]: Socket server starting...
sddm[1284]: Socket server started.
sddm[1284]: Loading theme configuration from ""
sddm[1284]: Greeter starting...
sddm[1284]: Adding cookie to "/var/run/sddm/{a1798342-b4d3-43d0-be36-518d4c6117d8}"
sddm-helper[2662]: [PAM] Starting...
sddm-helper[2662]: [PAM] Authenticating...
sddm-helper[2662]: [PAM] returning.
sddm[1284]: Greeter session started successfully
sddm[1284]: Message received from greeter: Connect
sddm[1284]: Message received from greeter: Login
sddm[1284]: Reading from "/usr/share/wayland-sessions/weston.desktop"
sddm[1284]: Reading from "/usr/share/wayland-sessions/weston.desktop"
sddm[1284]: Session "/usr/share/wayland-sessions/weston.desktop" selected, command: "weston"
sddm-helper[2945]: [PAM] Starting...
sddm-helper[2945]: [PAM] Authenticating...
sddm-helper[2945]: [PAM] Preparing to converse...
sddm-helper[2945]: [PAM] Conversation with 1 messages
sddm-helper[2945]: [PAM] returning.
sddm[1284]: Authenticated successfully
sddm[1284]: Jumping to VT 1
sddm[1284]: VT mode didn't need to be fixed
sddm-helper[2945]: Starting: "/home/gentoo/various/etc/X11/wayland-session weston"
sddm[1284]: Session started
sddm-helper[2945]: [PAM] Closing session
sddm-helper[2945]: [PAM] Ended.
sddm[1284]: Auth: sddm-helper exited with 1
sddm[1284]: Auth: sddm-helper exited successfully
sddm[1284]: Greeter stopped.

For some reason, sddm-helper fails to register properly when run "for wayland" while when run "for X" it works. What are the differences here? Can I somehow register a session manually to circumvent the (presumed) sddm bug?
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6385

PostPosted: Sun Oct 25, 2020 6:53 pm    Post subject: Reply with quote

Solved: I had used mount option hidepid=2 for the proc filesystem. This is not supported by systemd.

So much for increasing security with wayland...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum