Summary: | gui-wm/sway with sys-auth/elogind doesn't initialize DBUS_SESSION_BUS_ADDRESS properly | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Esteve Varela Colominas <esteve.varela> |
Component: | Current packages | Assignee: | Matthew Thode ( prometheanfire ) <prometheanfire> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | asturm, floppym, kensington, slashbeast, speedjack95 |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Esteve Varela Colominas
2022-12-26 15:20:03 UTC
Under systemd, the session/user bus is started by systemd --user whenever a login session is started. This happens via a bus call from pam_systemd to logind. The DBUS_SESSION_BUS_ADDRESS variable also gets set by the pam_systemd PAM module. https://github.com/systemd/systemd/blob/v252/src/login/pam_systemd.c#L284 elogind has the same code to set DBUS_SESSION_BUS_ADDRESS in pam_elogind, but I don't think it provide a way to automatically start dbus-daemon for a session bus. https://github.com/elogind/elogind/blob/v251-pre/src/login/pam_elogind.c#L301 I see. So in principle it wouldn't be necessary to `eval` the results of dbus-launch, as long as it's launched somehow before pam_elogind.so is invoked, and the bus appears in the right location? Neat. It's interesting though, because the apps that are failing with the current setup fall back to checing $XDG_RUNTIME_DIR/bus if the variable isn't set, which is a completely valid operation. However, dbus-launch is currently always putting the socket in /tmp/dbus-XXXXXXXXXX. I wonder if systemd forces the new location, or if it's dbus itself that does this and it somehow isn't doing it downstream? Sounds like a separate issue... So, yeah, since there's no equivalent to systemd --user that elogind can use, I guess this should be solved in either sway or sddm, possibly both. (In reply to Esteve Varela Colominas from comment #2) > I wonder if systemd > forces the new location, or if it's dbus itself that does this and it > somehow isn't doing it downstream? Just FYI, this happens in dbus.socket. https://github.com/freedesktop/dbus/blob/dbus-1.14.4/bus/systemd-user/dbus.socket.in#L5 When this unit is started, systemd creates a socket at the path specified by ListenStream. The %t is replaced with $XDG_RUNTIME_DIR, which defaults to /run/user/$UID. There's no equivalent functionality with OpenRC/elogind. Looking though the code that Floppym linked and taking into account that pam_elogind runs on the login only, it checks for $XDG_RUNTIME_DIR/bus to set this variable, I do not think it will work at all, perhaps this codepath was never working in the first place in elogind. The $XDG_RUNTIME_DIR for uid 1000 is /run/user/1000, and this directory is in fact created by pam_elogind upon login, it will not exist unless this is another *active* session of the same user. I think you might want to take to elogind upstream and check if they are willing to introduce support for it given your valid use case given the elogind's premise of being logind's standalone implementation. While not a solution to elogind not having feature parity with systemd-logind, you could try to change how sway is started. Instead of executing 'sway' have it run 'dbus-launch --exit-with-session sway' instead, exactly how the /etc/X11/xinit/xinitrc.d/80-dbus does it with $XSESSION. That should get you wayland session via sddm with $DBUS_SESSION_BUS_ADDRESS being set. In this case, I think we could declare that the problem is that elogind is not systemd and falls short without rest of systemd's interfaces. |