Support rootless Xorg
Right now we still use LightDM for Xorg sessions like i3wm, Mate and XFCE4, but it would be nice if these would be launched via tinydm as well.
I gave it a shot just a minute ago and Xorg failed to open tty1.
qemu-amd64:~$ cat .local/state/tinydm.log
--- tinydm ---
Date: Wed Oct 27 13:17:53 GMT 2021
Session: /usr/share/xsessions/i3.desktop
Desktop: i3
Exec: i3
---
X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
Build Operating System: Linux Alpine Linux
Current Operating System: Linux qemu-amd64 5.10.75-0-lts #1-Alpine SMP Thu, 21 Oct 2021 09:03:21 +0000 x86_64
Kernel command line: 'console=tty1 console=ttyS0 PMOS_NO_OUTPUT_REDIRECT PMOS_FORCE_PARTITION_RESIZE video=1024x768@60'
Build Date: 29 July 2021 11:02:43PM
Current version of pixman: 0.40.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/home/bart/.local/share/xorg/Xorg.0.log", Time: Wed Oct 27 13:17:53 2021
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) xf86OpenConsole: Cannot open virtual console 1 (Permission denied)
(EE)
(EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
(EE) Please also check the log file at "/home/bart/.local/share/xorg/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
I'm assuming this is happening because it launches Xorg as the user rather than root which most display managers do. Security-wise current behaviour is preferred, but we need to have the right permissions using something like elogind.
Strange enough just executing startx /usr/bin/i3 in tty1 manually works fine.
According to the Gentoo wiki it can be done by using dbus-launch --exit-with-session, but so far I couldn't get it work (when not using ~/.xinitrc).
Edited by Bart Ribbers