Disabling NIS

Team-Fly    

Solaris™ Operating Environment Boot Camp
By David Rhodes, Dominic Butler
Table of Contents
Chapter 12.  Naming Services and NIS


Before we finish this chapter, we'll look at the steps needed to disable NIS. This is actually quite easy to do, since there are only a few tasks that need to be completed. These will differ depending on whether we want to disable it completely, or, for example, demote a server to a client and so forth.

We also need to remember that we've been relying on NIS to supply most of our administration files, so we may need to copy them over to their correct locations before we disable NIS. Otherwise, we may have login failures, nonexistent user problems, and so on.

Let's look at some of the options we have and what we would need to do in each case.

Disabling a Slave Server

We've already explained that servers run both ypserv and ypbind, so all we need to do here is disable the server functionality of the machine and continue to let ypbind run.

The first thing to do is to alter the server's map on the master server so it won't try to propagate any changes to the slave and will also stop any other clients from trying to bind to it. We showed how to do this earlier in the section "The Server Map" on page 298, but we'll run through the steps again for fluorine (we'll use sed to quickly edit the ASCII file):

 tin# cd /var/yp/nis.solarisbootcamp.com tin# makedbm -u /ypservers > /tmp/oldServs tin# sed -e '/fluorine/d' < /tmp/oldServs > /tmp/newServs tin# makedbm /tmp/newServs ypservers tin# 

Checking the ypserver's map should show that fluorine is no longer on the server list, so then we can stop all the NIS processes running on it:

 fluorine# ypcat -k ypservers tin iodine fluorine# /usr/lib/netsvc/yp/ypstop flourine# 

Now we need to remove the map directory for the domain on the slave, which in our case is named /var/yp/nis.solarisbootcamp.com. This will stop ypserv from running when we restart the NIS services:

 fluorine# cd /var/yp fluorine# rm -r nis.solarisbootcamp.com flourine# 

Next, we can run ypstart. This time, we should see that only ypbind has been started:

 fluorine# /usr/lib/netsvc/yp/ypstart starting NIS (YP server) services: ypbind done flourine# 

Finally, we should see that the machine has correctly bound to a server other than itself:

 fluorine# ypwhich tin flourine# 

Disabling a Client

We are assuming here that disabling the client means that we will completely remove it from NIS. This means that if it was running any server process, then this has already been disabled following a procedure similar to that described above. First, we'll stop the NIS processes:

 carbon# /usr/lib/netsvc/yp/ypstop carbon# 

Now we'll update the naming service so it doesn't try to use NIS. We do this by either manually removing the "nis" entries from /etc/nsswitch.conf or by resorting back to the "local files" version of the switch files as shown below:

 carbon# cp /etc/nsswitch.files /etc/nsswitch.conf carbon# 

Next we can remove the /etc/defaultdomain file so that the domain name won't be set at boot-time:

 carbon# rm /etc/defaultdomain carbon# 

NIS is now disabled and won't be restarted the next time the machine is rebooted.


    Team-Fly    
    Top
     



    Solaris Operating Environment Boot Camp
    Solaris Operating Environment Boot Camp
    ISBN: 0130342874
    EAN: 2147483647
    Year: 2002
    Pages: 301

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net