On 28-Mar-07 10:47:17, Steve Engledow wrote:
So how is one *supposed* to make this all work? I need some way to get DISPLAY set correctly most of the time, I'd go crazy if I had to set it manually every time I rlogin to another machine here at work. I typically have five or six xterms open to Solaris boxes for example. Currently having it hardcoded in my .profile works 'most of the time' but it's then a big pain sorting out the ssh use because the special ssh value for DISPLAY is lost.
I'm sure there must be some environment variable or other that gets set if you're logging in to your machine remotely that doesn't get set if you log in directly. Set DISPLAY from .profile depending on the value of that variable?
Or... you could grep ps for your /(ba)?sh/ instance and see if it's running on a real vt or not... summat like that.
*clutches at straws*
Steve
I' ve just had a look, using various xterms in which I'm logged in to 3 other machines (2 on my home net, 1 on a remote net) at the results of "set". I'm doing this from home machine 1 called "compo.fort.knox.uk", "fort.knox.uk" being the local name for my home network, not know to the outside world.
Result from "set" executed on home machine 2 invoked from xterm displaying on home machine 1:
DISPLAY=compo.fort.knox.uk:0.0
Result from "set" on home machine 2, similarly invoked:
DISPLAY=compo.fort.knox.uk:0.0
Result from "set" on machine on remote net, similarly invoked (a FreeBSD machine, by the way):
DISPLAY=compo.fort.knox.uk:0.0
However, if I now switch (Ctrl-Alt-F1) to a plain console, and log in to all three remote machines in turn, then in all three cases there is no environment variable DISPLAY.
So DISPLAY gets set remotely if I log in from an xterm, but not if I log in from a text console (non-X). This suggests that there is something in the login sequence which negotiates with the logging-in machine and asks it what its DISPLAY is.
However, despite poking around, I can't find out where this happens!
ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@manchester.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 29-Mar-07 Time: 18:34:44 ------------------------------ XFMail ------------------------------