Solved

xdm login window - no hostname

Posted on 1998-06-23
15
415 Views
Last Modified: 2010-03-18
I have a linux box (Redhat 5) running xdm.
When I log in from a Win 95 xserver, the xlogin window shows the hostname as '1' instead of its correct name.
I believe the name is supposed to come from the file etc/X11/xdm/Xresources, where the line
xlogin*greeting: CLIENTHOST appears - I believe this is supposed to be replaced with the correct line by Xsetup.
As far as I can tell, other files appear to be correct.
0
Comment
Question by:argo
15 Comments
 

Expert Comment

by:xilef
ID: 1584577
Do the commands "uname -n" and/or "hostname" report the right name?

0
 

Author Comment

by:argo
ID: 1584578
Yes, the commands return the correct hostname.
0
 
LVL 1

Expert Comment

by:henckens
ID: 1584579
Did you enter the hostname in /etc/HOSTNAME ?
0
Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

Author Comment

by:argo
ID: 1584580
the hostname is correct in etc/HOSTNAME
0
 

Author Comment

by:argo
ID: 1584581
Increased points to 300
0
 
LVL 3

Expert Comment

by:marcelofr
ID: 1584582
the output of

# hostname -f

is correct? what if you "dig(1)" a bit?


0
 

Author Comment

by:argo
ID: 1584583

host name -f returns the correct name

what commands would you like me to enter within dig?
0
 
LVL 1

Expert Comment

by:chytrace
ID: 1584584
Coud you please send me the contents of the following files ?:
/etc/hosts
/usr/lib/X11/xdm/Xservers
/usr/lib/X11/xdm/Xresources
/etc/sysconfig/network

Regards
               Radovan
0
 

Expert Comment

by:spjuver
ID: 1584585
I don't understand theproblem issue. What is a 'Win 95 xserver'??
Do you use a X-emulator on a win 95 machine as X-client to a Linux-server??
Or do you use the win-95-look fvwm95 at the same machine??
0
 
LVL 1

Expert Comment

by:stormerider
ID: 1584586
Also, is it a possibility that you are getting the X display # rather than the hostname? Ie,
default on machine would be machine:0 for display, the next would be machine:1... does the client X viewer show you the display #? Have you tried another X client viewer on 95?


0
 

Author Comment

by:argo
ID: 1584587
This might be true - I am getting a '1' as the name, even if true, I cannot understand why only one of my three Linux machines does it.

Yes, I have tried Exceed 6, a demo copy of X-Win32 and MI/X - all with the same result.

0
 
LVL 2

Expert Comment

by:JYoungman
ID: 1584588
The xdm configuration file is loaded via xrdb.  xrdb passes the input file through the C preprocessor.  The "1" is absolutely typical of what happens when you have a preprocessor macro defined, but with no specified value.  

To investigate this, please run this command:-
echo "foo: CLIENTHOST" | xrdb -n -merge -

This should just say "foo: your-host-name", not "foo: 1".  If it says the latter, run this:-
echo "foo: CLIENTHOST" | strace -f -o TRACE xrdb -n -merge -
and see whar arguments are passed to /lib/cpp in the exec call
("grep exec TRACE").

0
 

Author Comment

by:argo
ID: 1584589
The first command does return foo: 1

The second gives

373   execve("/usr/X11R6/bin/xrdb", ["xrdb", "-n", "-merge"], [/* 20 vars */]) = 0
374   execve("/bin/sh", ["sh", "-c", "/lib/cpp -traditional -Dlinux -D"...], [/* 20 vars */]) = 0
374   execve("/lib/cpp", ["/lib/cpp", "-traditional", "-Dlinux", "-D__i386__", "-D_POSIX_C_SOURCE=199309L", "-D_POSIX_SOURCE", "-D_BSD_SOURCE", "-D_SVID_SOURCE", "-DHOST=paul", "-DSERVERHOST=paul", "-DSRVR_paul", "-DDISPLAY_NUM=0", "-DCLIENTHOST=linux", "-DCLNT_linux", "-DVERSION=11", "-DREVISION=0", ...], [/* 20 vars */]) = 0

it appears to contain the correct definition, so I'm still stuck...

0
 
LVL 2

Accepted Solution

by:
JYoungman earned 300 total points
ID: 1584590
Aha!
How funny!  (sorry! :-)

"linux" is ITSELF a macro, which the preprocessor defines with
the value 1.  How awkward.  You could prevent this happeining by passing the option -Ulinux to the /lib/cpp program, but I don't know of a way to do that.

The best solution is to add the line
      #undef linux

to /etc/X11/xdm/Xresources, somewhere before the first
line which references HOSTNAME.

0
 

Author Comment

by:argo
ID: 1584591
It was funny - I didn't even want the box called 'linux' it was just a name I gave it while setting up...

Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question