Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The meaning(s) of $DISPLAY (was Re: Explanation of X implementations)



On Nov 18, 2007, at 5:56 PM, Derek Fawcus wrote:

Well I consider the redefined contents of DISPLAY to be rather an ugly hack.

It should be possible for launchd to listen on the normal :0.0 (/ tmp/.X11-unix/:0)
for a connection, then when that socket can accept without blocking, spawn an
xserver and pass the listening socket to it. Launchd never calling accept on
the socket. Then if/when the xserver dies, launchd goes back to waiting for
the listening socket to be able to accept without blocking.


An alternate would be for launchd to do the first accept and pass the listen and
accepted sockets to the spawned Xserver, closing the accepted socket after the
fork and keeping the listening socket open. The Xserver then accepts for new
connections, and deals with the initial triggering connection.


The first scheme seems as if it may be easier to hack in to the xserver xtransport
stuff, as the server would have a chance to do its xinit stuff before it called
accept (i.e. it acts as if it was started before the first connections occurred).


(OK - I've never tried passing a listening socket fd, but is _should_ work :-)


Launchd is fully capable of listening to /tmp/.X11-unix/:0. However, the default plist specifies a random socket. This provides some degree of security, and also avoids problems with multi-user conflicts. If you tell launchd to list to the normal :0, what happens when multiple users attempt to use X11?
--
Andrew J. Hesford <email@hidden>
Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign


_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/x11-users/email@hidden

This email sent to email@hidden
References: 
 >Re: The meaning(s) of $DISPLAY (was Re: Explanation of X implementations) (From: Derek Fawcus <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.