Samuel Holland <sam...@sholland.org> wrote:
> It also works if X has permission to open the tty device read/write. Opening a
> tty as a session leader without a controlling terminal will set the 
> controlling
> terminal to that tty. Relevant kernel code:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/tty_jobctrl.c?h=v5.17#n129
> 
> And X will try to do that at startup (after failing to play with process 
> groups
> because it is already group leader):
> 
> https://gitlab.freedesktop.org/xorg/xserver/-/blob/master/hw/xfree86/os-support/linux/lnx_init.c#L207
> 
> I use a udev rule to set the tty owner:
> 
> $ cat /etc/udev/rules.d/99-tty.rules
> SUBSYSTEM=="tty", KERNEL=="tty1", OWNER="samuel", GROUP="samuel", MODE="0600"
> 
> And everything Just Works.

I currently have my tty owned by me whenever I login, with the group
set to tty.  The permissions are 600, so I would expect it to work
as long as I run X as my user, right? Unfortunately, I tried:
s6-setsid X :3 vt3
(on tty3), and had the same issue.  It's still trying to switch the vt.
Would I have to switch the group as well?  It seems that wouldn't
grant any additional privileges, especially since I am in the same
(supplementary) group as the tty?

It seems like a good option, I'm just unsure why it's not working?

Thanks!
--Dallin

Reply via email to