0

I'm aware there is a question with a similar issue, like this one, however the solutions within there are not specific enough for my situation.

I understand there is a way to start X using startx and xinit and logind, but I wanted to do things this way instead:

For context: I am using OpenSUSE Tumbleweed and Systemd

I am trying to use custom user targets and user services to start a bunch of programs upon login from a specific tty, and one of these services is the X server. For the time being, I have the following service file sitting in ~/.config/systemd/user/Xserver.service, which is meant to start an empty Xorg server on vt7:

[Unit]
Description=Starts the X server
After=default.target

[Service]
Type=simple
ExecStart=/usr/bin/X vt07 :0
NoNewPrivileges=false

[Install]
# Irrelevant as of time being, just some custom targets I plan on isolating later.

When attempting to start this service,(systemctl --user start Xserver.service) however, it fails with exit code 1, and hen reading the Xorg logs I find they say that "switching VT failed".

I understand X at that point is suppposed to be running with root privileges (due to setuid), and is already connected to /dev/tty7, so how is this happening?

What could I do to make it work?

PS: (The reasoning behind systemd allocating ttys dynamically doesn't apply here since I'll have already logged in to the tty by the time this service is started)

JSONMagic
  • 61
  • 5
  • Who owns /dev/tty7? You can check with `ls -l /dev/tty7` if you user doesn't have access to it, I don't believe X will start. If you want to confirm this try hack: `chmod 666 /dev/tty7` and try running your service. – TAAPSogeking Jul 27 '22 at 19:01
  • It's root, as it should, and X is running as root too. – JSONMagic Jul 28 '22 at 20:33
  • What do you mean "X is running as root"? I thought you were failing to start X as your user? So how can X already be running? Are you trying to run multiple X servers? – TAAPSogeking Jul 30 '22 at 08:41

0 Answers0