[Reviving an old bugreport which were closed] On Wed, 19 Aug 2020 01:58:27 +0200 Ben Fiedler <[email protected]> wrote:
Package: sway Version: 1.5-2+b1 Severity: importantDear Maintainer, when installing sway on a new machine it fails to launch as advertised ("just type sway into a tty and it will work"), instead displaying the following error message: 00:00:00.004 [ERROR] [backend/session/logind.c:218] Failed to activate session: Permission denied 00:00:00.004 [ERROR] [backend/session/direct-ipc.c:30] Do not have root privileges; cannot become DRM master 00:00:00.004 [ERROR] [backend/session/session.c:96] Failed to load session backend 00:00:00.004 [ERROR] [backend/backend.c:286] Failed to start a DRM session 00:00:00.004 [sway/server.c:49] Unable to create backend Similarily it seems that some loginctl commands are bricked as well, e.g. loginctl activate or loginctl lock-sessions. Installing policykit-1 resolves this issue.
The problem here is that sway, and actually any other gui environment (weston, even startx/Xorg) needs access to hardware. It asks logind for that, and logind uses polkitd for the task. But polkit isn't required - neither for sway nor for logind. For sway, dependency on polkitd is wrong. First it is because there are other alternatives exist to provide this functionality (eg seatd). And second because sway can be used within another wayland compositor or with a virtual desktop (like an rdp server for remote access), it is not limited to local hardware devices. I think Sway should Recommend polkitd (instead of depending on it), and maybe provide alternative (Recommands: polkitd | seatd). But actually this is a more general question to systemd. I understand that logind does provide (limited) functionality without polkitd just fine. What's the solution for problems like this? Should other packages pull in *logind* dependencies for it to provide extra functionality needed for these other packages? It is like inter-inter-dependency. Usually, when, say, library X uses some library Y, and library Z wants to use X, Z does not add Depends: Y, it is the X's task to depend on Y which *it* uses internally. Why polkitd is just a Sugges'ion of systemd, instead of a recommendation? There are many questions like this being asked. Thanks, /mjt
