Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A workaround for X11 sharing by multiple users' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A workaround for X11 sharing by multiple users
Authored by: hopthrisC on Feb 25, '04 04:34:19PM

Sorry, but this looks like a Really Bad Idea (tm)!!

Not only that, it is (normally) totally not necessary:

Start X11, open an XTerm, voilĂ  $DISPLAY is already set correctly, regardless of the number of users logged in.

If you really have to start an X-App from Term.app instead of an XTerm, simply use the open-x11 command, as in:

# open-x11 xeyes

Or have I completely misunderstood your problem?

Please clarify!



[ Reply to This | # ]
A workaround for X11 sharing by multiple users
Authored by: mzs on Feb 26, '04 11:18:10AM

I have to concur this hint is a REALLY BAD IDEA.

Here is my explanation of why this is the case:

You never ever EVER want to set the DISPLAY environment variable in a login script. You have no idea of what it needs to be set to. Let me repeat:

YOU HAVE NO IDEA WHAT IT NEEDS TO BE SET TO.

You still disagree, you think you have a nice script to figure it out in the hint, but you are wrong. Imagine that you ssh into a machine and wish to have your X11 connection forwarded. The login script will blow away the value that DISPLAY has been set to by ssh. If you have to use telnet, the .telnetrc file lets you do a similar thing. A simple hack with the TERM variable and it works with rlogin/rsh/remsh as well. I do not even want to get into VMS.

The point is that the Terminal app is not meant to run X11 apps from. Let your X11 environment set-up the X11 environment properly and run your X11 apps from there.

I am sorry to sound so caustic, but I just remembered how many times I have had to deal with green sysadmins in the past that put crap like this into the SYSTEM login files, so I had no easier way of fixing it except banging it into their heads why it was wrong. With no way to get to the submitter of this hint in meat-space, this comment will have to do.



[ Reply to This | # ]
A little tact would go a long way (was: workaround for X11 sharing by multiple users)
Authored by: The Lorax on Feb 27, '04 08:40:14AM

I'm sorry, where is it written that submissions to this site need to come from some sysadmin guru with 200 years experience? You make some VERY valid points about how DISPLAY settings can get you into trouble, but please, this site is called macosxHINTS.com, not bloody macos-snotty-mightier-than-thou-gurus.com. Don't discourage new members (like myself!) from posting with this kind of negative comback. We want posts, posters, and user experiences on this site, right?
Not "bah, green sysadmin, crap" and other such unhelpful nonsense which your points could have been made just as well without.

I for one found the original poster comments interesting. It (a) seemed to solve his immediate problem, (b) brought some interesting (mostly non-condescending) discussion (Imagine that!), and (c) brought forth a follow-on hint about the 'open-x11' command. I certainly learned from it all. So thanks 'spier' and 'hopthrisC'!!!!



[ Reply to This | # ]
A little tact would go a long way (was: workaround for X11 sharing by multiple users)
Authored by: hopthrisC on Feb 27, '04 12:31:01PM

Ah! A discussion thread I have never seen before ;)

I think I have advice for both kinds of posters:

To the newcomers in the daunting world of neverending frustrations (a.k.a. the UN*X experience): Whenever you have to invent something on your own to solve a problem, you most probably are somehow wrong.

30-odd years of UN*X-using, -hacking, -breaking and -tuning have seen it all and there is no problem you -- as a beginner -- can run into, that isn't already solved. Search for it, ask for it, it is there!

To the (thinks-he-is) guru: Allow for some slack! They are _beginners_. You can solve their problem lefthanded on a french keyboard while the terminal driver went bonkers and spews line noise at you, great!!

How are they supposed to find a solution to a problem when they neither know that one exists, nor even where to look for it. And don't give me "read the man pages" shit, cause they are wrong more often than not on OS X. (Although I have to admit that this particular poster should have read the X11 FAQ .-)

Tell them they have a bad solution. Tell them it is bad, because they themselves invented it. Tell them why this is almost always a Bad Idea (tm), but also tell them what the solution is!

_Especially_ in a forum where _your_ presence is purely voluntaryl The least this does is save you (and me) from one more lab that has $DISPLAY settings that make you wish for high-voltage LARTs.

Or -- to put it another way -- don't be sissies, don't be pricks!



[ Reply to This | # ]
A little tact would go a long way (was: workaround for X11 sharing by multiple users)
Authored by: speir on Feb 27, '04 05:28:48PM

I am not a sys admin (obvious by now ;). Why anyone would assume so perplexes me since this great site is an open public forum. I am an academic research scientist who studies viruses using biophysical methods, and a long time unix end user. My lab works on a stricly limited budget and can not employ a sys admin. So it is left to those of us willing to take on new enterprises (usually at personal cost) to extend our capabilities and solve some of our impediments. This is why I read this site and posted this hint here - like the great variety of non-admins out there I was looking for helpful discussion. I did look for the answer to my problem for the amount of time I could afford, and didn't run across the answer. Indeed, the capability I look for doesn't appear to exist. The open-x11 command is very close though and I will make use of it.

Not being a sys admin, I will never modify system files since it is not my expertise and outside my interests. I guess I didn't make it clear that I only suggest changes to a users individual setup files. Then the fix for any unforseen trouble, like remarked here for x11 forwarding, is to simply use the previously archived set up files.

I would rather spend my time studying the biology of viruses. What I have learned from these responses, with one exception, will allow me and my colleagues to continue to do so with improved capabilities. I thank hopthirsC, Ptitboul, and The_Lorax for their valuable time. You have done us a great service, and I hope you will continue to do so in the civil manner you have demonstrated for all who post here.



[ Reply to This | # ]
A workaround for X11 sharing by multiple users
Authored by: EccentricAnomaly on Aug 17, '04 11:17:22AM
You still disagree, you think you have a nice script to figure it out in the hint, but you are wrong. Imagine that you ssh into a machine and wish to have your X11 connection forwarded. The login script will blow away the value that DISPLAY has been set to by ssh. If you have to use telnet, the .telnetrc file lets you do a similar thing. A simple hack with the TERM variable and it works with rlogin/rsh/remsh as well. I do not even want to get into VMS.

humbug

here's the solution to the ssh/telnet whatever problem (rewrite in your fav. shell):


if (! $?DISPLAY) then
  setenv DISPLAY :0
endif

You can use login like the poster's script where 'setenv DISPLAY :0' is to figure out what the DISPLAY should be set too.

The point is that the Terminal app is not meant to run X11 apps from. Let your X11 environment set-up the X11 environment properly and run your X11 apps from there.

poppycock! I run X apps from Terminal all of the time. I like the Terminal's split screen and I like the way you can search in the buffer. Terminal is miles better than xterm.



[ Reply to This | # ]