NIS trouble

:eek: hi all,

I have a NIS trouble on a server.
when I create a file on a server (server1), the group of this file is the number of the group and not its name.
when I create a file with this group on another server which depends of another NIS slave, the file is created with the group name.
when I create a new group in the group map on the master, on this server ( server1 ), the new group name is not recognize.
I modified the group map by creating a new group, I did a make and I forced the synchronization of the map on the slave with :

# ypxfr -h masterNIS -d domain_name group.bygid

the answer was the master version is not newer

I think it's a synchronisation pb with the group.bygid map...

need your help.... :confused:

thx

The first step is to ypcat the NIS group file on all machines and make sure the NIS group file is seen everywhere. If it isn't, make sure ypbind is running and that each machine is bound to an NIS server using ypwhich. As for the ypxfer, assuming you haven't mucked around with the Makefile in /var/yp, the timestamps on the group source and the dbm group maps (i.e. group.bygid, etc.) determines if the map is pushed out or not. Try using the touch command to update the timestamp on the group source file and then use make in /var/yp to push it out. If it still doesn't push, please give the exact error message here and we will try to figure it out.

Thx for your reply

I modified passwd and group maps on NIS master and did a make which ended with no error. Replication is ok on all slaves, except on slave server1 where .byuid and .bygid are not updated. But ypcat on server1 gives all correct informations from the map.byname, i supposed...

sorry, the nis slave is not server1, server1 is the server which depend of the slave which has error...

Okay, I'm a little confused now. You have an NIS master and an NIS slave. Host server1 is an NIS client bound to the NIS slave?
If this is correct, I think you said that ypcat group on server1 shows the correct data. Is this true? If it is, what makes you think the group map is not getting updated. On which machine is ypcat failing to show the correct info?

hi, thx for your patience...

>>Okay, I'm a little confused now
*sorry, sorry for my bad english... :rolleyes:

>>You have an NIS master and an NIS slave. Host server1 is an NIS client bound to the NIS slave?
*yes, server1 is bind to nisslave1( and every other slaves work fine )

>>I think you said that ypcat group on server1 shows the correct data. Is this true?
*yes, it is surprising, but i think correct data come from passwd.byname or group.byname, i think i have a synchronisation Pb with group.bygid and passwd.byuid.

>>what makes you think the group map is not getting updated. On which machine is ypcat failing to show the correct info?

  • i have a user1 in group1(GID=100) (this group exists for a long time)
    i have a user2 in group2(GID=200) (this group is a newly created group)

on the server1
when i create a file with user1, the file owner is user1 group1
when i create a file with user2, the file owner is user2 200

on a server2 which binds to an other nis slave ( nisslave2) the owner is
user1 group 1 & user2 group2
and on nisslave2 the synchronisation is ok...

that's why i think it could be a nis probleme.:confused:

It does indeed look like some type of sync problem with group.bygid. It looks like the UID is getting translated by the map. Only the GID is the problem. The file is probably corrupted. To make sure everything is clean, I would re-intialize nisslave1 as a yp slave. You could probably just get rid of the group.bygid file, touch group on the master, and push the maps out. But a total re-init would give you a completely clean slave.

i can't re-init totally the nisserver1.
now i try to bypass the problem...before resolv it, it is very importante for my server'client
i want my server take a other nis server....
but, do you know a command to know if the nis slave is forced or if client's server bind my nisserver1 by broadcast ???

thx

When I said re-init nisserver1, I just meant re-init the NIS environment on it. If you clear out the old maps in /var/yp/binding/DOMAIN_NAME (DOMAIN_NAME = Your NIS domain) directory on nisserver1 and run ypinit -s MASTER_SERVER_NAME where MASTER_SERVER_NAME is the name of the NIS master configured in the NIS maps. This will set the machine up as a new NIS slave server with a fresh copy of the maps from the NIS master. You have to remove the old binding dir before ypinit -s will run for a re-init.

If you don't want to re-init NIS on nisserver1, then depending on which version of UNIX you are running, it is possible to specify which NIS server to bind to. For instance, on Solaris you run ypinit -c and specify a search order the NIS servers for each client. This creates a ypservers file /var/yp/binding/DOMAIN_NAME where DOMAIN_NAME is the NIS domain name. You can edit this file to add/delete/modify NIS servers. If you remove the file completely, the ypbind daemon starts as a broadcast daemon by default.

This behaviour for NIS on most flavors of UNIX I've worked on. If for some reason the flavor of UNIX you are using doesn't support ypinit -c (SCO for instance), you must start ypbind with the -ypsetme flag and use ypset to manually assign an NIS server.

If you tell me what UNIX OS you're running, I can give you specific instructions if you need them.

i have already understood that the re-init is just for NIS :slight_smile:

my NISserver is in linux debian 2.2.10
my master is in SunOS 5.5 and my client in HPux 11.00

i ever try to re-init the map group.bygid with the ypxfr command, it doesn't work anymore...

but, now i need to find a quickfix for this problem and i try my client bound a other nisserver which is in the same subnet and in the same VLAN...but my client do want to bind the other niserver, that's why i ask this question.
i finally find the solution; in HPux, the /etc/rc.config.d/namesvrs file contains informations on the different variables.

when i try a ypinit -s MASTER_NIS_SERVER
the nis slave responds :
"can't enumerate maps from MASTER_SERVER. Please check that it is running"

i used to know the NIS world, but now i discover the dark side of the NIS... :stuck_out_tongue: :confused:

thx for your patience

thx wizard, i build an other nisserver on the good VLAN, and my client server bound it...

now, i think i perhaps re-init the nisserver1 like you advise me

thx