Saturday, January 03, 2026

Re: [wayland] seatd VT switching and device access for wlroots-based programs

Le Fri, Jan 02, 2026 at 05:07:06PM +0100, Jeremie Courreges-Anglas a écrit :
>
> The common/terminal.c changes are just a minor cleanup for consistency
> with the FreeBSD code, I suspect the current port would work just as
> well.
>
> The hopefully more useful part of the diff: using the rc script and
> the instructions in the README I get working VT switching both from
> the wayland/greetd prompt and from a "startxfce4 --wayland" session
> using labwc. If you're using greetd please test with the diff I sent
> earlier today. For some reason startcagebreak.sh appears to error out
> and go back to the greetd prompt. Hopefully the debugging
> instructions in the README will prove useful. I haven't tested other
> compositors.

i've tested it somewhat successfully (eg greetd is on ttyC4, as is the xfce4
session), but something in seatd rendered the keyboard 'dead' (eg pressing keys
didn't give anything until i reboot) - that only happened when seatd was started
manually in a tmux, when started from rc the keyboard still works in my xfce
session (but vt switch doesnt).

in seatd debug output i saw this:
00:16:28.861 [common/terminal.c:292] Could not set keyboard mode to
translated: Inappropriate ioctl for device
which i think is related to the 'dead keyboard'.

vt switching indeed worked when the greeter was displayed, which is super nice
for debugging. But afaict only when seatd was started in a tmux/with debug, not
when started by rc.

as for ttys, when everything is started by rc, seatd and the greetd parent
process are on C0:

root 82222 0.0 0.1 1672 12140 C0- I 10:32AM 0:00.03 - /usr/local/bin/greetd
root 34880 0.0 0.0 800 1432 C0- I 10:32AM 0:00.00 - /usr/local/bin/seatd -g seat
root 82430 0.0 0.0 780 1560 C0 I+pU 10:32AM 0:00.01 - /usr/libexec/getty std.9600 ttyC0

and labwc/greetd child process are on C4:

root 49752 0.0 0.1 1736 12244 C4 I+ 10:33AM 0:00.03 `-- /usr/local/bin/greetd --session-worker 13
landry 75413 0.0 0.0 772 1544 C4 I+ 10:33AM 0:00.00 `-- dbus-run-session -- labwc --config-dir /home/landry/.config/xfce4/labwc --config /home/landry/.config/xfce4/labwc/rc.xml --session xfce4-session
landry 43910 0.0 0.0 2584 4120 C4 S+ 10:33AM 0:00.44 |-- dbus-daemon --nofork --print-address 4 --session
landry 4855 0.8 0.8 42904 120188 C4 S+ 10:33AM 0:05.52 `-- labwc --config-dir /home/landry/.config/xfce4/labwc --config /home/landry/.config/xfce4/labwc/rc.xml --session xfce4-session

> It would be tempting to add a _seatd group instead of telling users to
> add a local one, but well, it wouldn't remove the need for explicit
> configuration steps and we're short on uids/gids (tm).

i'm all for adding the _seatd group, you could reuse stalwart-jmap/564 which
puts it next to _greetd, which seems 'logical'. end users shouldn't have to
fiddle with that (and with the default _seatd group for the /var/run/seatd.sock
socket), and we should find a way to put the _greetd user in the _seatd group
automatically.

in all cases, that definitely goes in the right direction, many thanks
for digging into this. I'll do more testing :)

Landry

No comments:

Post a Comment