[Xquartz-dev] I got it working, but still potential problem (Re: Getting bad DISPLAY value during use of 2.6.1-2.6.2 (not with 2.6.0 & before).)

SciFi sci-fi at hush.ai
Mon Apr 25 07:49:31 PDT 2011


Got it working, but I don't know it'll survive a reboot.
Worried that after booting we will lose /tmp/.X11-unix (the actual problem now).
Let me try to explain.

While logged-on under root, I ended-up moving the two plists under /System/Library/Launch* for Apple's X11, to related "(Disabled)" subdirs.  That effectively cleared 'em out completely.

We still have the two plists for Xquartz under /Library/Launch*.
I.e. it's like this now:

$ ls -l {~,/System,}/Library/Launch*/org.*startx*
ls: cannot access /Users/scifi/Library/Launch*/org.*startx*: No such file or directory
-rw-r--r-- 1 root wheel 627 Apr 24 10:12 /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
-rw-r--r-- 1 root wheel 696 Apr 24 10:12 /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
-rw-r--r-- 1 root wheel 592 Apr 24 10:31 /System/Library/LaunchAgents(Disabled)/org.x.startx.plist
-rw-r--r-- 1 root wheel 661 Apr 25 07:07 /System/Library/LaunchDaemons(Disabled)/org.x.privileged_startx.plist


Rebooted.

The first thing I checked, after logging back on as me (not root), is to be sure DISPLAY has the new-fangled string.
It did:

$ set
[…]
DISPLAY=/tmp/launch-8jWL7Z/org.macosforge.xquartz:0
[…]

$ launchctl getenv DISPLAY
/tmp/launch-8jWL7Z/org.macosforge.xquartz:0

Started-up Xquartz.app.  Oh it definitely could see the correct DISPLAY now, but it still errored-out, and would loop-de-loop wanting to keep attempting to start the server:

-- snip from system.log --
[…]
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]: X11.app: do_start_x11_server(): argc=4
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]: 	argv[0] = /opt/X11/bin/X
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]: 	argv[1] = :0
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]: 	argv[2] = -nolisten
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]: 	argv[3] = tcp
Apr 25 08:45:06 scifi org.macosforge.xquartz.startx[535]: Xquartz: Handoff connection established (try 1 of 5) on fd 6, "/var/tmp/tmp.0.xgqSx8".  Sending message.
Apr 25 08:45:06 scifi org.macosforge.xquartz.startx[535]: Xquartz: Message sent.  Closing handoff fd.
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]: Xquartz starting:
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]: X.Org X Server 1.10.0.902
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]: Build Date: 20110411
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]: _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]: _XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 2
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]: _XSERVTransMakeAllCOTSServerListeners: failed to create listener for local
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]: Fatal server error:
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]: Cannot establish any listening sockets - Make sure an X server isn't already running
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]:    OsVendorFatalError
Apr 25 08:45:06 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[522]:    AbortDDX
[… and so on …]
-- end snip --

Yes the subsystem kept looping this, kept wanting to (re)start the server, kept getting the little "abort" panel flashed on the Desktop (getting in my way, it wants focus every time), etc.

Turns out we did *not* have /tmp/.X11-unix built.
I quickly logged-in as root, and did a mkdir for it.
Then the next server-start loop saw it, but griped about permissions:

-- snip from system.log later-on --
[…]
Apr 25 08:51:02 scifi org.macosforge.xquartz.startx[50616]: Build Date: 20110411
Apr 25 08:51:02 scifi org.macosforge.xquartz.startx[50616]: _XSERVTransmkdir: ERROR: Mode of /tmp/.X11-unix must be set to 1777
Apr 25 08:51:02 scifi org.macosforge.xquartz.startx[50616]: _XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 1
Apr 25 08:51:02 scifi org.macosforge.xquartz.startx[50616]: _XSERVTransMakeAllCOTSServerListeners: failed to create listener for local
[…]
-- end snip --

Okay, fine, I quickly did a
$ chmod 01777 /tmp/.X11-unix
(while still root)
and -voila- on the next server-start loop, it finally came up.
(and stopped looping)

-- snip from system.log later-later-on --
[…]
Apr 25 08:51:53 scifi org.macosforge.xquartz.startx[56901]: Xquartz starting:
Apr 25 08:51:53 scifi org.macosforge.xquartz.startx[56901]: X.Org X Server 1.10.0.902
Apr 25 08:51:53 scifi org.macosforge.xquartz.startx[56901]: Build Date: 20110411
Apr 25 08:51:54 scifi org.macosforge.xquartz.startx[56901]: (EE) Error loading keymap /tmp/server-0.xkm
Apr 25 08:51:54 scifi org.macosforge.xquartz.startx[56901]: (EE) XKB: Failed to load keymap. Loading default keymap instead.
Apr 25 08:51:54 scifi org.macosforge.xquartz.startx[56901]: /opt/X11/bin/xinit: XFree86_VT property unexpectedly has 0 items instead of 1
Apr 25 08:51:56 scifi org.macosforge.xquartz.startx[56901]: X11.app Handing off fd to server thread via DarwinListenOnOpenFD(6)
Apr 25 08:51:56 scifi org.macosforge.xquartz.startx[56901]: DarwinListenOnOpenFD: 6
Apr 25 08:51:56 scifi org.macosforge.xquartz.startx[56901]: Calling ListenOnOpenFD() for new fd: 6
Apr 25 08:51:56 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[0]: X11.app: Launching /opt/X11/bin/xterm:
Apr 25 08:51:56 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[0]: 	argv[0] = /bin/sh
Apr 25 08:51:56 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[0]: 	argv[1] = -c
Apr 25 08:51:56 scifi [0x0-0x2d02d].org.macosforge.xquartz.X11[0]: 	argv[2] = /opt/X11/bin/xterm
Apr 25 08:52:02 scifi org.macosforge.xquartz.privileged_startx[541]: font_cache: Updating FC cache
Apr 25 08:52:04 scifi org.macosforge.xquartz.privileged_startx[541]: font_cache: Done
[…]
-- end snip --

…

Now, as I relax and catch my breath,
I think we will still have a problem.
(I am thinking this had been our earlier problem, too, actually.)
You said the /tmp stuff gets cleared-out on a reboot (earlier in this thread).
This means we will lose the .X11-unix subdir there,
and will need to manually mkdir it all over again
after booting-up.
Was this suppose to have been automatically done during another phase, somehow?
What should we do in this case, please?


Thank you for spending time on this.





More information about the Xquartz-dev mailing list