Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#43000 closed defect (worksforme)

Macports install fails to launch X11

Reported by: agtebo@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: jeremyhu (Jeremy Huddleston Sequoia)
Port: xorg-server, demeter

Description (last modified by ryandesign (Ryan Schmidt))

I recently upgraded an installed application that was installed through Macports. After upgrading this application now is no longer plotting to X11 the way it used to, in fact, it's not plotting at all even though X11 is definitely installed on my system. I have wiped all of Macports, uninstalled it, and reinstalled everything. There are less error messages, but it's still no longer communicating with X11 as it previously did. I have a feeling this has to do with my $DISPLAY variable, which was switched to XQuartz instead of the xorg that I had previously been using, and which uninstalling and reinstalling Macports has not fixed. Any help would be appreciated.

echo $DISPLAY
/tmp/launch-KcoXVw/org.macosforge.xquartz:0

Change History (12)

comment:1 Changed 7 years ago by agtebo@…

Cc: agtebo@… added

Cc Me!

comment:2 Changed 7 years ago by ryandesign (Ryan Schmidt)

Cc: jeremyhu@… added; agtebo@… removed
Description: modified (diff)

comment:3 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: worksforme
Status: newclosed

I have a feeling this has to do with my $DISPLAY variable, which was switched to XQuartz instead of the xorg that I had previously been using, and which uninstalling and reinstalling Macports has not fixed.

It's configured to launch XQuartz, from http://xquartz.macosforge.org ... that's XQuartz.app

I'm not sure what you mean by "instead of the xorg that I had previously been using"

It sounds like you probably trashed things you shouldn't've.

Please ask for help on the #xquartz IRC channel or x11-users mailing list.

comment:4 Changed 7 years ago by agtebo@…

Nevermind. I managed to find the old configuration on my computer and manually set $DISPLAY to point back to x.org, which fixed the problem.

comment:5 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Don't manually set DISPLAY.

Also, you don't explain what you mean by "back to x.org"

comment:6 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

If you're on Lion or older and want to use the host's X11.app instead of XQuartz.app, you just need to disable's XQuartz' LaunchAgent as discussed in the FAQ. Please don't manually muck around with things.

comment:7 Changed 7 years ago by agtebo@…

I understand that I shouldn't mess around with things manually, but installing xorg-server is automatically setting $DISPLAY to their server, even when I disable their LaunchAgent as per the FAQ. All I'd really like to do is have my $DISPLAY to be the Macports version of X11 since the other important piece of software I'm using is on Macports, but this seems to get lost somewhere. I can't seem to get LaunchAgent to use the Macports server, although it will load. Logging out and then back in reverts it back to the XQuartz server. Thanks.

comment:8 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

installing xorg-server is automatically setting $DISPLAY to their server, even when I disable their LaunchAgent as per the FAQ

What do you mean "installing xorg-server is automatically setting $DISPLAY to their server" ... that is not true.

What do you mean "their LaunchAgent as per the FAQ"? I maintain XQuartz, xorg in MacPorts, and the XQuartz DDX for X.org, and I'm pretty certain that we (X.org) don't have a FAQ for XQuartz. There is no X.org FAQ which talks about LaunchAgents that I am aware of.

is have my $DISPLAY to be the Macports version of X11 since the other important piece of software I'm using is on Macports

Then follow the instructions printed by the xinit port for how to do that and disable the other LaunchAgents.

comment:9 Changed 7 years ago by agtebo@…

This is the FAQ to which I am referring: http://xquartz.macosforge.org/trac/wiki/X11-UsersFAQ

According to the xinit portfile to select the Macports port as the default, I need to log out and then back in after installing it and loading the LaunchAgent. I did that, and nothing changed with my DISPLAY.If I deactivate the macosforge LaunchAgent it won't unload completely. If I load MacPorts, it says it's loaded but doesn't change the DISPLAY. Same with x.org as well (this is after logging out and back in). I've removed their version from my computer, so I don't know how their LaunchAgent keeps superseding the ones I try to load.

Is there any way to see why Macports is not being installed as the default? Many thanks.

comment:10 in reply to:  9 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Replying to agtebo@…:

This is the FAQ to which I am referring: http://xquartz.macosforge.org/trac/wiki/X11-UsersFAQ

That is the XQuartz FAQ, not an X.org FAQ.

According to the xinit portfile to select the Macports port as the default, I need to log out and then back in after installing it and loading the LaunchAgent. I did that, and nothing changed with my DISPLAY.

You need to also disable the XQuartz LaunchAgent.

If I deactivate the macosforge LaunchAgent it won't unload completely.

What do you mean by that? What do you mean by "deactivate" and what do you mean by "won't unload completely". Copy/paste exactly what you're doing from terminal and its output.

If I load MacPorts, it says it's loaded but doesn't change the DISPLAY.

If you have multiple LaunchAgents setting DISPLAY, it's not guaranteed which one will win. You need to load only one and then relog.

Same with x.org as well (this is after logging out and back in).

What do you mean "x.org" ? Do you mean XQuartz?

I've removed their version from my computer, so I don't know how their LaunchAgent keeps superseding the ones I try to load.

I assume you mean XQuartz. What did you do to remove XQuartz? My guess is you didn't follow the instructions in the FAQ and left the LaunchAgent.

Is there any way to see why Macports is not being installed as the default?

Run this:

launchctl list | grep startx

That will tell you which startx agents are loaded.

You need to have only one loaded, and it needs to be loaded at login.

comment:11 Changed 7 years ago by agtebo@…

Here is what that looks like:

agtebo$ echo $DISPLAY
/tmp/launch-KcoXVw/org.macosforge.xquartz:0
agtebo$ launchctl list | grep startx
-       1       org.x.startx
-       0       org.macports.startx

I'm confused as to how my DISPLAY is showing macosforge if it's not listed as one of the startx list.

agtebo$ launchctl unload -w /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
launchctl: Error unloading: org.macosforge.xquartz.startx

which I presume because it's no longer part of the starts list. Then,

agtebo$ launchctl load -w /Library/LaunchAgents/org.macports.startx.plist
org.macports.startx: Already loaded

So I log back out and back in, and then:

agtebo$ echo $DISPLAY
/tmp/launch-KcoXVw/org.macosforge.xquartz:0

I am sure I'm being an idiot. What am I missing here?

Thanks again.

comment:12 in reply to:  11 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Replying to agtebo@…:

Here is what that looks like:

agtebo$ echo $DISPLAY
/tmp/launch-KcoXVw/org.macosforge.xquartz:0
agtebo$ launchctl list | grep startx
-       1       org.x.startx
-       0       org.macports.startx

I'm confused as to how my DISPLAY is showing macosforge if it's not listed as one of the startx list.

You likely *HAD* it loaded when your session started and had since unloaded it.

agtebo$ launchctl unload -w /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
launchctl: Error unloading: org.macosforge.xquartz.startx

Depending on what version of OS X you have, you may need to use 'sudo' to have that disabled in the plist rather than a per-user override.

Furthermore, this indicates that you did not uninstall XQuartz per the instructions in the FAQ. You need to remove that LaunchAgent's launchd.plist if you deleted XQuartz. Check out the FAQ or just re-install XQuartz.

which I presume because it's no longer part of the starts list. Then,

agtebo$ launchctl load -w /Library/LaunchAgents/org.macports.startx.plist
org.macports.startx: Already loaded

So I log back out and back in, and then:

agtebo$ echo $DISPLAY
/tmp/launch-KcoXVw/org.macosforge.xquartz:0

I am sure I'm being an idiot. What am I missing here?

I'm guessing that org.macosforge.xquartz.startx is still loaded or you did not wait long enough for per user launchd to terminate (depending on your verison of OS X).

Seeing as how you deleted XQuartz.app, you should remove the launchd.plist.

Note: See TracTickets for help on using tickets.