[Xquartz-dev] 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 03:36:17 PDT 2011
(I see Hushmail still has their bug: their own editor won't follow the Reply email thread properly. Let me try their IMAP interface via Apple-Mail.)
On Apr 24, 2011, at 18:27, Jeremy Huddleston wrote:
>
> On Apr 24, 2011, at 10:22, sci-fi at hush.ai wrote:
>>>
>>> You should have
>>> /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
>>>
>>> What is the output of "launchctl list org.macosforge.xquartz.startx"
>>
>> $ launchctl list org.macosforge.xquartz.startx
>> {
>> "Label" = "org.macosforge.xquartz.startx";
>> "LimitLoadToSessionType" = "Background";
>> "OnDemand" = true;
>> "LastExitStatus" = 0;
>> "TimeOut" = 30;
>> "ProgramArguments" = (
>> "/opt/X11/bin/startx";
>> );
>> "EnableTransactions" = true;
>> "TransactionCount" = -1;
>> "Sockets" = {
>> "org.macosforge.xquartz:0" = (
>> file-descriptor-object;
>> );
>> };
>> };
>>
>>
>>>> <snip/>
>>>>
>>>> (There is no critter named /tmp/.X11-unix (shown via ls -al) presently
>>>> on my system.
>>>> The /tmp dir itself does have root:wheel ownership with "drwxrwxrwt"
>>>> flags.)
>>>
>>> It should be created by /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
>>>
>>> What is the output of "sudo launchctl list org.macosforge.xquartz.privileged_startx"
>>
>> $ sudo launchctl list org.macosforge.xquartz.privileged_startx
>> Password:
>> {
>> "Label" = "org.macosforge.xquartz.privileged_startx";
>> "LimitLoadToSessionType" = "System";
>> "OnDemand" = true;
>> "LastExitStatus" = 0;
>> "TimeOut" = 120;
>> "ProgramArguments" = (
>> "/opt/X11/lib/X11/xinit/privileged_startx";
>> "-d";
>> "/opt/X11/lib/X11/xinit/privileged_startx.d";
>> );
>> "EnableTransactions" = true;
>> "TransactionCount" = -1;
>> "MachServices" = {
>> "org.macosforge.xquartz.privileged_startx" = mach-port-object;
>> };
>> };
>>
>>
>>> […]
>>
>> During these lists, none of the X (sub)tasks are running now.
>>
>> BTW I dug a bit and found:
>> $ ls -al /tmp/launch-34Cqdu
>> total 0
>> drwx------ 2 scifi wheel 102 Apr 24 10:25 .
>> drwxrwxrwt 11 root wheel 544 Apr 24 11:56 ..
>> srwx------ 1 scifi wheel 0 Apr 24 10:25 org.macosforge.xquartz:0
>>
>> so _something_ was trying to work right.
>
> And I bet if you do 'export DISPLAY="/tmp/launch-34Cqdu/org.macosforge.xquartz:0"', it'll work as well...
>
> Did you create a separate LaunchAgent for org.x.startx (like in /Library/LaunchAgents or ~/Library/LaunchAgents)? launchd should prefer /Library over /System/Library when determining the environment.
>
> What is the output of:
>
> ls -l {~,/System,}/Library/Launch*/org.*startx*
>
>
>> But the timestamps might tell something -- the "wrong" one might've been created during when we rebooted, 19-minutes earlier:
>
> No. /tmp is cleared at boot.
>
>> $ ls -al /tmp/launch-s9kPWX
>> total 0
>> drwx------ 2 scifi wheel 102 Apr 24 10:06 .
>> drwxrwxrwt 11 root wheel 544 Apr 24 11:56 ..
>> srwx------ 1 scifi wheel 0 Apr 24 10:06 org.x:0
>>
>>
>> Another BTW -- I don't have anything like ~/.x* critters either, nor in /etc . ;)
$ pwd
/Users/scifi
$ 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/org.x.startx.plist
-rw-r--r-- 1 root wheel 631 Jul 6 2009 /System/Library/LaunchDaemons/org.x.privileged_startx.plist
I had tried to "disable" the Apple-provided entries (reason for its modified timestamp) but I can't remember if I had this marked during the reboot (this iMac machine is quite busy sometimes, many schedules going on):
$ cat /System/Library/LaunchAgents/org.x.startx.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>Label</key>
<string>org.x.startx</string>
<key>ProgramArguments</key>
<array>
<string>/usr/X11/bin/startx</string>
</array>
<key>Sockets</key>
<dict>
<key>org.x:0</key>
<dict>
<key>SecureSocketWithKey</key>
<string>DISPLAY</string>
</dict>
</dict>
<key>ServiceIPC</key>
<true/>
<key>EnableTransactions</key>
<true/>
</dict>
</plist>
But I didn't know about the other plist, it is still the original file and timestamp:
$ cat /System/Library/LaunchDaemons/org.x.privileged_startx.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.x.privileged_startx</string>
<key>ProgramArguments</key>
<array>
<string>/usr/X11/lib/X11/xinit/privileged_startx</string>
<string>-d</string>
<string>/usr/X11/lib/X11/xinit/privileged_startx.d</string>
</array>
<key>MachServices</key>
<dict>
<key>org.x.privileged_startx</key>
<true/>
</dict>
<key>TimeOut</key>
<integer>120</integer>
<key>EnableTransactions</key>
<true/>
</dict>
</plist>
$ _
I have some ideas to try, now.
I'll also try the "forced" spelling for DISPLAY as you indicated, for the X-app-user's shell, if needed.
But how do we "force" the launchd/launchctl change at _that_ level for DISPLAY? (Review my first email in this thread, please.) It seems a user cannot alter that particular env-var with a simple launchctl line, yes I have tried several different ways (unsetenv included). See, _that_ is the level seen by the Xquartz start-up system, IIUC, and is the crux of this problem -- in essence, my system has the "misspelled" DISPLAY string at this level, which affects the start-up of Xquartz & company, and I *cannot* change it prior to *re*-starting Xquartz.app.
The only thing I can think of, is to be sure the X-related Apple plists are actually "disabled", while the Xquartz plists are the only ones "active". (irregardless of your "placement" scheme, see)
Even if I must "move away" the Apple plists, I want to be sure the Xquartz ones are left.
Then I'll reboot to be sure the correct ones are loaded, etc etc etc. ;)
All this is a hunch of mine, now. ;)
(I have EyeTV running, it is busy recording now, its schedule is open in a few hours.)
Thank you again.
More information about the Xquartz-dev
mailing list