View previous topic :: View next topic |
Author |
Message |
Skotlex Guru

Joined: 13 Mar 2004 Posts: 313
|
Posted: Fri Jul 10, 2020 3:06 am Post subject: [SOLVED] Starting a new Xorg-server (-suid) on another vt? |
|
|
I decided, after reading the recent news, to try migrating my xorg-server to run -suid.
It works fine, except that I can't launch an xserver in a different vt than the one I am currently at. This is problematic because previously I would launch a server on vt6 from my current session in vt5, as a way to play games at full screen and not have to deal with the window manager or whatever.
When xorg-server was +suid, all I had to do was invoke "xinit <script to launch game> -- :1 vt7", but doing that now gives a permission denied message.
Code: |
> xinit ./game.sh -- :1 vt7
X.Org X Server 1.20.8
X Protocol Version 11, Revision 0
Build Operating System: Linux 5.4.48-gentoo x86_64 Gentoo
Current Operating System: Linux Zarielle 5.4.48-gentoo #1 SMP Sat Jul 4 12:02:35 -05 2020 x86_64
Kernel command line: root=PARTUUID=C714510A-BFF3-4128-9B09-A387527D1015 ro quiet acpi_osi=Linux acpi_backlight=vendor ath9k.nohwcrypt=1 ath9k.ps_enable=1
Build Date: 09 July 2020 12:30:34PM
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/games/.local/share/xorg/Xorg.1.log", Time: Thu Jul 9 22:01:21 2020
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) xf86OpenConsole: Cannot open virtual console 7 (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/games/.local/share/xorg/Xorg.1.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Bad file descriptor
xinit: server error
|
I imagine this is because xorg-server isn't suid anymore. But is there a (SAFE) way to have a user open a server on a different vt than they are currently at? Or should I just focus on logging in from a different vt when I need a new x-server instance for my gaming sessions?
Code: |
> emerge -pv xorg-server
These are the packages that would be merged, in reverse order:
Calculating dependencies... done!
[ebuild R ] x11-base/xorg-server-1.20.8:0/1.20.8::gentoo USE="elogind libglvnd udev xorg -debug -dmx -doc -ipv6 -kdrive -libressl -minimal (-selinux) -static-libs -suid -systemd -unwind -wayland -xcsecurity -xephyr -xnest -xvfb"
|
Last edited by Skotlex on Sun Jul 12, 2020 2:01 am; edited 1 time in total |
|
Back to top |
|
 |
halcon l33t


Joined: 15 Dec 2019 Posts: 673
|
Posted: Sat Jul 11, 2020 5:07 pm Post subject: Re: Starting a new Xorg-server (-suid) on another vt? |
|
|
Skotlex wrote: | is there a (SAFE) way to have a user open a server on a different vt than they are currently at? |
I know one way to do that:
Code: | chown user:tty /dev/tty7 | (where user is the name of your user).
This could be placed, for example, in /usr/bin/startx (with sudo). |
|
Back to top |
|
 |
Skotlex Guru

Joined: 13 Mar 2004 Posts: 313
|
Posted: Sun Jul 12, 2020 2:01 am Post subject: Re: Starting a new Xorg-server (-suid) on another vt? |
|
|
halcon wrote: | Skotlex wrote: | is there a (SAFE) way to have a user open a server on a different vt than they are currently at? |
I know one way to do that:
Code: | chown user:tty /dev/tty7 | (where user is the name of your user).
This could be placed, for example, in /usr/bin/startx (with sudo). |
Thanks, this really helps! I can pre-assign on startup a console for my users, and then get back what I was used to running before. |
|
Back to top |
|
 |
halcon l33t


Joined: 15 Dec 2019 Posts: 673
|
Posted: Sun Jul 12, 2020 10:41 am Post subject: Re: Starting a new Xorg-server (-suid) on another vt? |
|
|
Skotlex wrote: | I can pre-assign on startup a console for my users, and then get back what I was used to running before. |
I have currently chown user in /usr/bin/startx on the line just after variables declaring (enable_xauth=1), and then chown root back on the line after xinit "$client"...
Having this modified version of startx, it's useful to add it to CONFIG_PROTECT. |
|
Back to top |
|
 |
Hu Administrator

Joined: 06 Mar 2007 Posts: 23570
|
Posted: Sun Jul 12, 2020 3:57 pm Post subject: |
|
|
Rather than manually merging future changes, why not configure Portage to automatically patch in these changes during the build, and then remove the use of CONFIG_PROTECT? |
|
Back to top |
|
 |
halcon l33t


Joined: 15 Dec 2019 Posts: 673
|
Posted: Sun Jul 12, 2020 4:23 pm Post subject: |
|
|
Hu wrote: | Rather than manually merging future changes, why not configure Portage to automatically patch in these changes during the build, and then remove the use of CONFIG_PROTECT? |
Indeed. I'm not used much to portage patches (and patches at all), it's a lapse on my part. Especially now, after I patched the amd driver and saw how well it worked with an offset. Thanks! |
|
Back to top |
|
 |
Hu Administrator

Joined: 06 Mar 2007 Posts: 23570
|
|
Back to top |
|
 |
halcon l33t


Joined: 15 Dec 2019 Posts: 673
|
Posted: Sun Jul 12, 2020 6:34 pm Post subject: |
|
|
Yeah, this EAPI5+ system is much more easy to use than the old bashrc style. I remember how I used that old style...
I'd like to correct myself: I'm not used much to patches but used to diffs. That is I use diff files often for viewing, showing changes and almost never - for patching (when there are commits, pull/push is enough). Now I've got a reason to use patching more often - with Portage. |
|
Back to top |
|
 |
|