I installed KDE Plasma (~amd64) with the Wayland USE flag set. When I try to log in to KDE, after entering my password, the login screen disappears for a moment but then comes back. In the .xsession-errors file in my home directory, I can find the following message: startplasmacompositor: Starting up... startplasmacompositor: Could not start D-Bus. Can you call qdbus? After some searching I found out that /usr/bin/startplasmacompositor is a shell script that generates that message. In it, there's a variable called $qdbus, and I modified the script to get more information. In particular, I inserted the following lines: echo $qdbus 1>&2 $qdbus 1>&2 This gave me the information that the $qdbus variable contains a correct value, /usr/lib64/qt5/bin/qdbus. The result of executing that (on the second of the lines I added) gives the following error: Could not connect to D-Bus server: org.freedesktop.DBus.Error.NoServer: Failed to connect to socket /tmp/dbus-ItSvaBy02e: Connection refused. I can see (from a TTY, whether or not logged in on the window system) that the dbus daemon is running. I think OpenRC started it although dbus is not explicitly in any runlevel. When I log in to KDE with the non-wayland session, there is no problem with the dbus. For info, the dbus version is sys-apps/dbus-1.10.6. I'll attach emerge --info output in a moment.
plasma requires the logind interface, which usually means systemd. If you're keen, you could try sys-auth/elogind from the KDE overlay.
Created attachment 425730 [details] emerge --info
I'll read more about systemd and elogind. If Wayland expects systemd, should the setting of the wayland USE flag then not also pull in systemd somehow?
The logind interface is normally implemented by systemd, but in theory could be implemented by anything. Projects such as elogind popped up to allow use of this feature instead of switching to systemd. In theory, simply installing elogind should be enough as it will be called at runtime via dbus.
I've now changed the system to use systemd instead of OpenRC. So far, so good. However, the error message is exactly the same as before. When I log in to KDE using lightdm and the "Wayland" plasma session, the screen goes black for an instant, then the login prompt is back. From a TTY I can read the .xsession-errors file, and it contains the same message as before about not being able to start D-Bus. When I type "qdbus" at the command line, I get a listing that includes two items, :1.0 org.freedesktop.systemd1 :1.2 org.freedesktop.DBus This error doesn't seem to be caused by configuration options in my user's .kde4 directory because even when I rename that, it's the same error.
I've switched to systemd and changed a few other things, so marking this as Resolved because I won't be able to reproduce the bug now.