2

The process name used to run the Xorg server changed recently on RHEL from X to Xorg and more recently the XWayland came along as the new Wayland server has been introduced. I noticed that on old versions the Xorg process and the related command line argument was something like this:

/usr/bin/X -nr -nolisten tcp :0 vt1 -auth /var/run/kdm/A:0-uyAhRO

The X file was actually just a symbolic link to /usr/bin/Xorg. Then on RHEL8 the command changed to something like:

/usr/libexec/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3

The following questions arise from the topic:

1) Why the old versions was using X as process name instead of Xorg ?

2) Why the DISPLAY argument (:0) has been removed in the latest releases ?

3) I could figure out what display the Xorg server was running on just by reading the process command line arguments. This is not working anymore. What if need to do this on modern distros ?

4) I already get the DISPLAY variable from the program environment but I need to check if this matches the Xorg display. This because I need to run the program on the same display where Xorg is running. Is it still relevant to perform this check or can I assume ":0" nowadays ?

1

1) Because the original free X server became somewhat commercial at some stage, so a free variant XFree86 split off it, which then became X.org after some politics and drama. Wikipedia has a bit of history, but, like all contentious history, be careful of the bias of the writer(s).

But all this was long long ago terms of computing. Anyhow, the binary name eventually (apparently much later) changed from X to Xorg because of that, so all distros (not only RHEL) had to follow suit.

2) If you read man Xorg, it's now an optional parameter. My memory might be wrong, but I think it was mandatory before. It's simpler if scripts don't have to bother specifying it.

3) You could e.g. use lsof to find out which process uses /tmp/.X11-unix/X0 (or whereever your distro puts the unix domain sockets for X).

4) No, you don't check that. Ever. The assumption is that if DISPLAY is set, you use this display. No matter if five X servers are running on your local machine, a dozen people are logged in via ssh with X forwarding, and you can reach another ten X servers via your local LAN via TCP sockets (rare today): You use the DISPLAY you are given, because that's the display the user wants out of all possible ones (and possibly the only one his authorized to use).

And if you don't want that one, nearly all programs have -display commandline argument you can use to override it.

If you can't contact an X server with a given display, then you can't contact it, and the program will stop with an error message. But you don't do an additional check for that.

  • Regarding point 1, the XFree86-to-X.org change is much older than the X-to-Xorg change; RHEL 7, the X-running distro in this question, used X.org. – Stephen Kitt Oct 10 '19 at 19:03
  • I believe also RHEL6 uses X.org. Anyway on RHEL6 and 7 the process is X while on RHEL8 the process changed to Xorg. – Bemipefe Oct 11 '19 at 8:36
  • @dirkt For point 3) how can that give me the display used by Xorg ? X0 = the Xorg display is ":0" ? On RHEL8 I have X0 and X1024 in that folder. – Bemipefe Oct 11 '19 at 8:42
  • The "display" 1024 is probably used by XWayland because its command line arguments contain ":1024". – Bemipefe Oct 11 '19 at 8:47
  • @Bemipefe Yes, you figured it out. – dirkt Oct 11 '19 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.