fix: give the live session user access to the console VT
Xorg failed to start with:
(EE) xf86OpenConsole: Cannot open virtual console 1 (Permission denied)
udev leaves console VTs as 620 root:tty — group tty has write-only, so
even a tty-group member can't open /dev/tty1 read+write (display managers
normally get this via logind seat ACLs, which a manually-started X
doesn't have). The session script now chowns the dedicated VT to
liveuser before starting X; the unit already Conflicts with getty@tty1 so
nothing else needs it.
This commit is contained in:
@@ -10,9 +10,20 @@ set -euo pipefail
|
||||
|
||||
export DISPLAY=:0
|
||||
LXUSER=liveuser
|
||||
VT=1
|
||||
TTY="/dev/tty$VT"
|
||||
|
||||
# udev leaves console VTs as 620 root:tty — group tty has write-only, no read,
|
||||
# so Xorg's xf86OpenConsole fails with "Cannot open virtual console (Permission
|
||||
# denied)". This VT is dedicated to the installer (the unit Conflicts with
|
||||
# getty@tty1), so hand it to liveuser outright.
|
||||
chown "$LXUSER" "$TTY" 2>/dev/null || true
|
||||
|
||||
# clear stale X state from a previous attempt in the same boot
|
||||
rm -f /tmp/.X0-lock /tmp/.X11-unix/X0 2>/dev/null || true
|
||||
|
||||
# 1. start Xorg as the unprivileged user on vt1 (no -allow-root; it's gone)
|
||||
runuser -u "$LXUSER" -- /usr/bin/Xorg :0 vt1 -nolisten tcp &
|
||||
runuser -u "$LXUSER" -- /usr/bin/Xorg :0 "vt$VT" -nolisten tcp &
|
||||
XPID=$!
|
||||
|
||||
# 2. wait for the X socket
|
||||
|
||||
Reference in New Issue
Block a user