Operating System - HP-UX
1829102 Members
2450 Online
109986 Solutions
New Discussion

Adding NIS Client to Master

 
samash
Advisor

Adding NIS Client to Master

Can someone give the the steps in adding a NIS client. OS is 11i.

Thanks!!!
14 REPLIES 14
Steven E. Protter
Exalted Contributor

Re: Adding NIS Client to Master

Shalom,

vi /etc/rc.config.d/namesvrs

The file is self documented.

# NIS_MASTER_SERVER: 1 if this node is the master NIS server, 0 if not.
# NIS_SLAVE_SERVER: 1 if this node is a slave NIS server, 0 if not.
# NIS_CLIENT: 1 if this node is a NIS client, 0 if not.
# NISPLUS_SERVER: 1 if this node is a NIS+ server, 0 if not.
# NISPLUS_CLIENT: 1 if this node is a NIS+ client, 0 if not.
# EMULYP: -Y to have rpc.nisd support YP clients.
# NISDOMAIN: the NIS domain name (see domainname(1)).


Change NIS_CLIENT to 1 and add an NIS_MASTER

/sbin/init.d/nis.client start

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
samash
Advisor

Re: Adding NIS Client to Master

Thanks, I give it a shot!!
samash
Advisor

Re: Adding NIS Client to Master

Steven,

Here's the error I get. Any idea?

NIS_MASTER_SERVER=0
NIS_SLAVE_SERVER=1
NIS_CLIENT="1"
NISPLUS_SERVER=0
NISPLUS_CLIENT=0
NIS_DOMAIN="burris"
MAX_NISCHECKS=2
EMULYP=""
YPSERV_OPTIONS=""
YPBIND_OPTIONS=""
YPPASSWDD_OPTIONS="/etc/passwd -m passwd PWFILE=/etc/passwd"
KEYSERV_OPTIONS=""
YPUPDATED_OPTIONS=""
YPXFRD_OPTIONS=""
RPC_NISD_OPTIONS="$EMULYP"
NIS_CACHEMGR_OPTIONS=""
YPSET_ADDR="192.168.1.90"
LONGNAMES_OPTIONS="group.bygid.dir group.bygid.pag group.byname.dir \
group.byname.pag hosts.byaddr.dir hosts.byaddr.pag \
hosts.byname.dir hosts.byname.pag networks.byaddr.dir \
networks.byaddr.pag networks.byname.dir networks.byname.pag \
passwd.byname.dir passwd.byname.pag passwd.byuid.dir \
passwd.byuid.pag protocols.byname.dir protocols.byname.pag \
protocols.bynumber.dir protocols.bynumber.pag \
rpc.bynumber.dir rpc.bynumber.pag services.byname.dir \
services.byname.pag ypservers.dir ypservers.pag"

SHORTNAMES_OPTIONS="group.bygi.dir group.bygi.pag group.byna.dir \
group.byna.pag hosts.byad.dir hosts.byad.pag \
hosts.byna.dir hosts.byna.pag netwk.byad.dir \
netwk.byad.pag netwk.byna.dir netwk.byna.pag \
passw.byna.dir passw.byna.pag passw.byui.dir \
passw.byui.pag proto.byna.dir proto.byna.pag \
proto.bynu.dir proto.bynu.pag rpc.bynu.dir \
rpc.bynu.pag servi.byna.dir servi.byna.pag \
ypservers.dir ypservers.pag"
WAIT_FOR_NIS_SERVER=FALSE
"namesvrs" 101 lines, 3808 characters
brant:/etc/rc.config.d # /sbin/init.d/nis.client start
starting NIS CLIENT networking
starting up the rpcbind
rpcbind already started, using pid: 1256
domainname burris
starting up the Network Information Service
starting up the ypbind daemon
FAILURE CODE: 1
calling ypset with 192.168.1.90
Sorry, I can't set up a udp connection to ypbind on host brant.
Checking NIS binding.
Bound to NIS server using domain burris.
starting up the keyserv daemon
keyserv already started, using pid: 16445
brant:/etc/rc.config.d # ypcat passwd
ypcat: can't bind to an NIS server for domain burris.
Reason: can't communicate with ypbind
brant:/etc/rc.config.d #

Dave Olker
Neighborhood Moderator

Re: Adding NIS Client to Master

Hi Samash,

I recommend you use a slightly different set of steps:

1) Set the NIS domainname

# domainname


2) Run the "ypinit -c" command

This command will prompt you for a list of NIS servers. Please enter in the list of all your current NIS servers in the order of preference that the client should bind to. In other words, if you definitely want the client to bind to a specific server, enter that name first followed by any other servers in the NIS domain.


3) Modify the /etc/rc.config.d/namesvrs file

In this file you need to - at a minimum - set the NIS_DOMAIN variable to the NIS domain the client resides in, and set the NIS_CLIENT variable to 1.


4) Start NIS on the client

# /sbin/init.d/nis.client start


Give these steps a try and let me know if you have any problems with them.

Regards,

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
samash
Advisor

Re: Adding NIS Client to Master

Thanks Dave,

I'll give it a try!!
Dave Olker
Neighborhood Moderator

Re: Adding NIS Client to Master

Hi Samash,

One other point of clarification - do NOT set the NIS_MASTER variable in the /etc/rc.config.d/namesvrs file if this system is only a client.

Setting the NIS_MASTER variable to anything other than 0 tells the system that this machine is the master server for the NIS domain. If this system is only a client then it will not contain any NIS maps and cannot be a server.

On a pure NIS client the only variables that need to be changed are NIS_CLIENT=1 and NIS_DOMAIN=.

Regards,

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
samash
Advisor

Re: Adding NIS Client to Master

Thanks,

Dave. Here's is what my namesvrs file looks like. I also have the luxury of comparing to another NIS client. Note: the error when I ypcat the passwd file.

Thanks

NIS_MASTER_SERVER=0
NIS_SLAVE_SERVER=0
NIS_CLIENT="1"
NISPLUS_SERVER=0
NISPLUS_CLIENT=0
NIS_DOMAIN="burris"
MAX_NISCHECKS=2
EMULYP=""
YPSERV_OPTIONS=""
YPBIND_OPTIONS=""
YPPASSWDD_OPTIONS="/etc/passwd -m passwd PWFILE=/etc/passwd"
KEYSERV_OPTIONS=""
YPUPDATED_OPTIONS=""
YPXFRD_OPTIONS=""
RPC_NISD_OPTIONS="$EMULYP"
NIS_CACHEMGR_OPTIONS=""
YPSET_ADDR="192.168.1.90"


Dave Olker
Neighborhood Moderator

Re: Adding NIS Client to Master

Hi Samash,


NIS_MASTER_SERVER=0
NIS_SLAVE_SERVER=0
NIS_CLIENT="1"
NISPLUS_SERVER=0
NISPLUS_CLIENT=0
NIS_DOMAIN="burris"
MAX_NISCHECKS=2
EMULYP=""
YPSERV_OPTIONS=""
YPBIND_OPTIONS=""
YPPASSWDD_OPTIONS="/etc/passwd -m passwd PWFILE=/etc/passwd"
KEYSERV_OPTIONS=""
YPUPDATED_OPTIONS=""
YPXFRD_OPTIONS=""
RPC_NISD_OPTIONS="$EMULYP"
NIS_CACHEMGR_OPTIONS=""
YPSET_ADDR="192.168.1.90"


There is no reason to set the YPSET_ADDR parameter if you used the "ypinit -c" option to build a list of NIS servers. Did you run ypinit -c and specify a list of *valid* NIS servers? If so then please unset the YPSET_ADDR variable and stop/start nis.client. I'd be interested in the output of the "nis.client start" command and any output from a "ypcat -k passwd" command once the client has bound to a server.

Regards,

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
samash
Advisor

Re: Adding NIS Client to Master

Dave,

I did not run ypset. I did not want to make too radical of a change since the other client works. If you think it would work. I'll do it. I was comparing apples to apples that's all.

Please advise!!
samash
Advisor

Re: Adding NIS Client to Master

I'm sorry that was ypinit -c. Not ypset. Doing too many things at once.

Thanks
Dave Olker
Neighborhood Moderator

Re: Adding NIS Client to Master

Hi Samash,

The fact that the other clients work and they have the YPSET_ADDR option set in their namesvrs files tells me they are using the ypset feature of NIS to forcibly bind to a specific server. If you want to do that you can, but I *highly* recommend you instead use the "ypinit -c" option to specify a list of NIS servers instead.

The biggest problem with the ypset feature is that once it binds to the specific server - if that server stops responding the client will drop the connection to the server and start sending UDP broadcast packets on the local subnet looking for a replacement server. If there are no local NIS servers on the same subnet as the client then it will not bind to anyone and any NIS lookup requests will hang.

Again, the "ypinit -c" route is recommended over ypset as it allows you to tell the client specifically which servers to bind to and in what order. Much nicer than the old ypset mechanism.

Regards,

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
samash
Advisor

Re: Adding NIS Client to Master

Thanks

Dave I'll give it a try!!
samash
Advisor

Re: Adding NIS Client to Master

Dave,

I was off a few days last week. Should ypbind be running on both master and client? If so, is it ypbind start?

Thanks
Dave Olker
Neighborhood Moderator

Re: Adding NIS Client to Master

Hi Samash,

> Should ypbind be running on both master
> and client? If so, is it ypbind start?

Ypbind is a client process so it definitely needs to be running on any NIS client. However I don't think I've ever seen an NIS master that wasn't also using NIS itself as a client, so ypbind usually does run on NIS servers. However, if for some reason you want the NIS servers to *not* use NIS for backend resolution (host, passwd, services, etc.) then you can make them strictly servers by not setting the NIS_CLIENT=1 in the namservrs file.

Again, the vast majority of NIS servers are also clients and therefore run ypbind.

ypbind is started with the "/sbin/init.d/nis.client start" command is issued at boot time. You can manually start ypbind with that command as well.

Regards,

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