Re: The meaning(s) of $DISPLAY (was Re: Explanation of X implementations)
Re: The meaning(s) of $DISPLAY (was Re: Explanation of X implementations)
- Subject: Re: The meaning(s) of $DISPLAY (was Re: Explanation of X implementations)
- From: "Ambrose Li" <email@hidden>
- Date: Sat, 17 Nov 2007 02:18:40 -0500
On 17/11/2007, Eric Gouriou <email@hidden> wrote:
> On Nov 16, 2007, at 8:50 PM, Ambrose Li wrote:
>
> > This reminds me of something. Before launchd support, the
> > standard way to check whether a script is running in X (that
> > is, whether X is *already* up) is to check whether $DISPLAY
> > is defined. Now that assumption is wrong. This means that
> > launchd support has broken backward compatibility in a very
> > fundamental level.
>
> $DISPLAY being set means that X is _available_, not that the
> user desires to get X clients started or that contacting
> the X server is a 0-cost operation. Indeed it can already
> be pretty expensive to contact an already running server,
> for example when operating over long latency connections.
> Thanks to launchd, X is always running on Leopard. It's just
> very, very good at consuming no resources as long as it has
> no clients. That's similar to traditional network services
> started via xinetd, "the ssh server" is available as soon as
> it is configured, whether an instance of the sshd executable
> is currently running or not.
I would think that this is backwards. Thanks to launchd, X is
always *available*. Certainly when you first log in (unless
you have it set to run in System Preferences) it is *not*
running. On the other hand, on a non-Leopard system, if $DISPLAY
is set, the worst thing that can happen is that it is set to
a crashed server so any X command errors out, but any script
can then trap the error and conclude that X is not really
available. (Ok, this is not the worst; the worst could be
$DISPLAY pointing to another still-running server that is at
somewhere you don't expect. But this is still nowhere near
expectedly *starting up* an X server when all you want is to
check for its existence, for example.)
> > (I would bet that this is why .bash_profile or .bashrc is
> > running X programsbecause $DISPLAY is set so it assumes that
> > it *should* run those X programs.)
>
> I always had DISPLAY set on Tiger, whether I had started X or
> not, because I did not want to type "DISPLAY=:0.0 <command>"
> if I wanted to start an X client from a Terminal (or iTerm
> then) window. Somehow it never caused me much harm, even
> though I used to connect to very remote systems in this way
> (>500ms ping times).
Surely it would not cause any harm, because of the reason I
mentioned above.
--
cheers,
-ambrose
Yahoo and Gmail must die. Yes, I use them, but they still must die.
PS: Don't trust everything you read in Wikipedia. (Very Important)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden