1833758 Members
2225 Online
110063 Solutions
New Discussion

nis issues -

 
SOLVED
Go to solution
lawrenzo
Trusted Contributor

nis issues -

Hello,

very urgent!

NIS master # ypcat passwd |wc -l

output is 23

# cat /etc/passwd |wc -l
output is 1107

the nis master files seem to have become corrupt and we have many users not able to login

has anyone got any tips please
hello
7 REPLIES 7
Dave Olker
Neighborhood Moderator

Re: nis issues -

I assume the "cat /etc/passwd" output was from the NIS master, and that this system is configured to build the NIS passwd tables from the /etc/passwd file and not some other source. If that is the case, I'd try:

# touch /etc/passwd
# /var/yp/ypmake

Make sure the passwd maps are re-built and pushed to any slaves.

Dave


I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
Rick Garland
Honored Contributor

Re: nis issues -

Also check to ensure that the /etc/passwd file is the passwd file used for NIS. Could be named passwd.yp or something else. Check your yp scripts that do the make and find out what is being pushed out to the slaves
lawrenzo
Trusted Contributor

Re: nis issues -

The issue is that someone pushed out the maps from a client server corrrupting the environment.

We have logged a call with HP and they have advised to run ypinit -m,

during this process the system is asking for slaves

what commnad can be run to identify slave servers form the master>?

Thanks
hello
Dave Olker
Neighborhood Moderator

Re: nis issues -

The way I typically determine which systems were configured as slaves during the previous incarnation of "ypinit -m" is to un-makedbm the ypservers map.

Try this:

# cd /var/yp/
# makedbm -u ypservers

On my NIS master, this returns:

hpatcux1 hpatcux1
hpatcux2 hpatcux2
hpatcux4 hpatcux4
YP_LAST_MODIFIED 1092346033
YP_MASTER_NAME hpatcux1

This shows the master is "hpatcux1" and the slaves are "hpatcux2" and "hpatcux4".

Good luck,

Dave



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
lawrenzo
Trusted Contributor

Re: nis issues -

Thanks everone,

After running commands with ypservers, it was evident that the master NIS was pointing to a slave server.

this happened because the ypmake was used on a server other than the master

To prevent this would I have to add something to the ypmake script to determine which server the command is being run on?

Many thanks
hello
Rick Garland
Honored Contributor
Solution

Re: nis issues -

You could add to the ypmake script some logic that is testing the hostname value.
if [ `hostname` != ]
then
echo "not here!"
exit
fi

Could be as simple as this or as elaborate as you want.
lawrenzo
Trusted Contributor

Re: nis issues -

Thank you all
hello