Operating System - HP-UX
1833913 Members
2144 Online
110063 Solutions
New Discussion

Re: dhcp and the demon DISPLAY variable

 
SOLVED
Go to solution
Ron Irving
Trusted Contributor

dhcp and the demon DISPLAY variable

Probably a dumb question, but I'll ask anyway. How does HP-UX, (ver 10.20,) deal with dhcp, and the DISPLAY variable? Here's the thing: When a user gets a new ip address, our application asks what display setting he/she wants. If they choose the wrong one, BOOM!! No more login, but just for that ip address. I took that ip address to another system, used another user login, and BOOM!! The same thing happened. The workstations are getting the addresses from an independent dhcp server. The HP-UX server has a static ip address.

Any clues??

Thanx in advance,

Ron Irving
Should have been an astronaut.
7 REPLIES 7
John Bolene
Honored Contributor

Re: dhcp and the demon DISPLAY variable

UNIX is not real friendly with dhcp.
All our servers and X-terms have static IP's.

In fact, @home has implemented dhcp for most locations and you can only get a static IP if you tell them that you run a UNIX machine.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Kenneth Platz
Esteemed Contributor
Solution

Re: dhcp and the demon DISPLAY variable

Ron,

There are a couple of possibilities that I can think of that would help you deal with DHCP and the DISPLAY variable:

1) If you are using CDE (or any other XDMCP-compliant login mechanism) to login to your server, then the XDMCP protocol will handle the assignment of the DISPLAY variable for you. Whenever a UNIX server running CDE receives a request for a CDE session, the CDE login daemon (dtlogin) will set the DISPLAY variable based upon the IP address of the actual system performing the request. This does have two drawbacks, however:

a) If you are using a Windows NT DNS server, make sure that it provides both forward AND reverse resolution for your DHCP clients. Some NT-based DNS server implementations will hang when they receive an invalid request for a PTR lookup, and this will cause your CDE login to potentially fail.

b) If your IP address changes within a session, then you will still be in the same situation (however, you can always kill/restart your session and get the correct DISPLAY variable).

2) If you are using a PC-based client, such as Reflection/X or eXceed, they usually include a mechanism for embedding the DISPLAY variable in the command string. I believe for Reflection/X it is something like:

xterm -display %IP#%

You could always set your application launch to do the same within Reflection/X.

I hope this helps.
I think, therefore I am... I think!
Ron Irving
Trusted Contributor

Re: dhcp and the demon DISPLAY variable

Thanks, Kenneth. That pointed me in (what I think is) the right direction. We are running 'eXceed' here. You mentioned the XDMCP protocol. Is that used while using eXceed, too?? Where is the configuration file for that protocol? So far, this is the only ip address affected. Perplexing. I should have been a bus driver.

ron
Should have been an astronaut.
Kenneth Platz
Esteemed Contributor

Re: dhcp and the demon DISPLAY variable

Ron,

You should be able to configure your eXceed session to perform an "XDMCP Direct" request. You will simply need to enter the IP address and/or hostname of your HP-UX server, and ensure that the "dtlogin" daemon is running.

If you have any further questions, I'd recommend looking at document ID KBRC00000465 - "How to setup Exceed to run CDE". You should be able to find this in the Technical Knowledge Base, or I can post this or email this to you.
I think, therefore I am... I think!
Ron Irving
Trusted Contributor

Re: dhcp and the demon DISPLAY variable

Ok...I'm always thinking of something. How is the DISPLAY variable set in the .profile? If I were to put an ip addy in there, wouldn't that screw up the rest of the workstations on my dhcp network, with different assigned ip addresses?

Hello???

anyone...???
Should have been an astronaut.
Bill McNAMARA_1
Honored Contributor

Re: dhcp and the demon DISPLAY variable

Try with the who -R command to get the users ip address.. who am i will return the tty, who -R for ip.
You can script it up yourself!

ie
MYTTY=$(who am i | awk nonsense print whatever field)
DISPLAY=$(who -R |grep $MYTTY| awk once more)
export DISPLAY!

I'm sure there's an easier way!!
(It's been a while since I've scripted!

Later,
Bill
It works for me (tm)
Kenneth Platz
Esteemed Contributor

Re: dhcp and the demon DISPLAY variable

Ron,

If you are using either an XDMCP session (ie, if you follow the document I mentioned and login through the CDE login banner), or you start up an xterm window with a command similar to:

xterm -display %IP#%

you will find that your DISPLAY variable will be automatically set so you will not have to reset it in your .profile.

If your display variable is not already set, then you can do something like:

export DISPLAY=$( who -u am I | awk '{ print $8":0" }' )
I think, therefore I am... I think!