Bug 475749 - ypwhich -m and ypwhich -m passwd show wrong nis server
Summary: ypwhich -m and ypwhich -m passwd show wrong nis server
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: yp-tools
Version: 5.1
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Vitezslav Crhonek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-12-10 09:39 UTC by Lutz Lange
Modified: 2009-09-23 13:05 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-23 13:05:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Lutz Lange 2008-12-10 09:39:13 UTC
Description of problem:
I have configured my system as a nis client for server1.example.com. 
# ypwhich 
server1.example.com

BUT :
[root@station1 ~]# ypwhich -m
rpc.byname localhost
protocols.byname localhost
services.byname localhost
services.byservicename localhost
netid.byname localhost
passwd.byuid localhost
group.bygid localhost
passwd.byname localhost
rpc.bynumber localhost
group.byname localhost
mail.aliases localhost
protocols.bynumber localhost
hosts.byaddr localhost
hosts.byname localhost

There should be the server1.example.com listed as second field here.
Same for :
# ypwhich -m passwd
localhost

Expected result:
server1.example.com

Version-Release number of selected component (if applicable):
yp-tools-2.9-0.1

How reproducible:
bind to NIS domain, call ypwhich -m or ypwhich -m passwd

Comment 1 Vitezslav Crhonek 2008-12-10 10:14:28 UTC
Hm, works for me flawlessly.

Please let me see your /etc/yp.conf, /etc/sysconfig/network and output of "domainname" command.

I'm able to get different answer from "ypwhich" and "ypwhich -m" only when NIS server and client is on the same machine and client is configured with "domain X server localhost" in /etc/yp.conf. If configured with "domain X server base-os-05", then "ypwhich" and "ypwhich -m" are same.

[root@base-os-05 yp]# ypwhich 
localhost.localdomain
[root@base-os-05 yp]# ypwhich -m
rpc.byname base-os-05.englab.brq.redhat.com
netid.byname base-os-05.englab.brq.redhat.com
services.byservicename base-os-05.englab.brq.redhat.com
protocols.byname base-os-05.englab.brq.redhat.com
passwd.byname base-os-05.englab.brq.redhat.com
passwd.byuid base-os-05.englab.brq.redhat.com
mail.aliases base-os-05.englab.brq.redhat.com
ypservers base-os-05.englab.brq.redhat.com
rpc.bynumber base-os-05.englab.brq.redhat.com
hosts.byname base-os-05.englab.brq.redhat.com
group.byname base-os-05.englab.brq.redhat.com
group.bygid base-os-05.englab.brq.redhat.com
services.byname base-os-05.englab.brq.redhat.com
hosts.byaddr base-os-05.englab.brq.redhat.com
protocols.bynumber base-os-05.englab.brq.redhat.com

But that's not a bug of course.

Comment 2 Lutz Lange 2008-12-10 10:51:40 UTC
[root@station1 ~]# egrep -v '^(#|$)' /etc/yp.conf
domain notexample server 192.168.0.254

[root@station1 ~]# domainname
notexample

[root@station1 ~]# cat /etc/sysconfig/network
NETWORKING_IPV6=yes
HOSTNAME=station1.example.com
NETWORKING=yes
NISDOMAIN=notexample

Hope that helps

Comment 3 Vitezslav Crhonek 2008-12-10 11:23:02 UTC
I suppose that 192.168.0.254 is server1.example.com, which is different from station1.example.com. I see nothing wrong in these files.

If you ypcat some map, is the result correct (I mean proper map from server1.example.com, e.g. passwd.byname)? In other words, is NIS working fine, only ypwhich shows bad server?

Comment 4 Lutz Lange 2008-12-10 11:26:36 UTC
Yes server1.example.com is 192.168.0.254.
And i do have the correct map data available. It's just the wrong server that is shown with ypwhich -m ...f

Comment 5 Vitezslav Crhonek 2009-09-23 11:52:56 UTC
I didn't notice this behaviour during that time and I'm not able to reproduce it consciously.

I configure NIS this way habitually:
1. add NISDOMAIN to /etc/sysconfig/network on the server
2. set domainname
3. run ypserv service on the server
4. run /usr/lib(64)/yp/ypinit -m on the server
5. config /etc/yp.conf (domain NISDOMAIN server SERVER) on the client
6. run ypbind service on the client
7. test ypwhich, ypwhich -m, ... on the client

I didn't see any differnce between ypwhich and ypwhich -m. Do you have some certain advance how to reproduce it?

Comment 6 Lutz Lange 2009-09-23 13:05:58 UTC
Im unable to reproduce this today. But we have changed our configuration a bit. We now employ a ypservers file on server1 - which was missing previously.
[root@server1 ~]# cat /var/yp/ypservers
192.168.0.254

This my be the reason, that thinks work correctly now.

[root@station12 ~]# ypwhich -m
protocols.bynumber server1.example.com
services.byname server1.example.com
services.byservicename server1.example.com
passwd.byname server1.example.com
rpc.bynumber server1.example.com
passwd.byuid server1.example.com
protocols.byname server1.example.com
hosts.byname server1.example.com
rpc.byname server1.example.com
mail.aliases server1.example.com
group.byname server1.example.com
netid.byname server1.example.com
group.bygid server1.example.com
hosts.byaddr server1.example.com


Note You need to log in before you can comment on or make changes to this bug.