Configuring the Network Infomation Service (NIS) (part5)

You should have at least one NIS slave server to provide backup if the NIS master server becomes unavailable. To configure an NIS slave server, complete the following steps on the system that you want to designate as the slave server:

  1. Edit the /etc/inet/hosts file to ensure that the NIS master and all NIS slave servers have been defined.
  2. Execute the domainname command to set the local NIS domain.
    # domainname domainname

    For example:

    # domainname classroom.Central.Sun.COM 
  3. Create or populate the /etc/defaultdomain file with the domain name.
  4. Initialize the system as an NIS client by performing the command:
    # ypinit -c
  5. When the system prompts for a list of NIS servers, enter the NIS master host followed by the name of the local host and all other NIS slave servers on the local network.
  6. Copy the /etc/nsswitch.nis file to the /etc/nsswitch.conf file. If necessary, modify the file.
  7. On the NIS master, ensure that the ypserv process is running by performing the command:
    # pgrep -fl ypserv

    If it is not running, refer to the previous section on how to start NIS daemons on the master.

  8. Return to the proposed NIS slave system, and enter the ypstart command to start the ypbind daemon.
    # svcadm enable svc:/network/nis/client:default
  9. Initialize the system as an NIS slave by performing the command:
    # ypinit -s master

    where master is the name of the NIS master.

    Note: If you did not add the name of the NIS slave server when you initially configured the NIS master server using the ypinit command, enter the ypinit -m command once more on the NIS master server. In the process of updating the NIS master, the script prompts you for confirmation when it is about to destroy the existing domain database. Confirm by entering y.
  10. Before starting the ypserv daemon on the slave server, stop the client with the command:
    # svcadm disable svc:/network/nis/client:default
  11. When the NIS server is started, it also starts the ypbind client daemon.
    # svcadm enable svc:/network/nis/server:default
  12. To test NIS client functionality on the newly configured NIS slave server, perform the command:
    # ypwhich -m

    The output shows a list of maps together with the NIS master server for each map.

Because database files change with time, you must update your NIS maps. To update the NIS maps (on the master server), complete the following steps:

  1. Update the text files in your source directory (typically, /etc, unless it was changed in the Makefile file).
  2. Change to the /var/yp directory.
    # cd /var/yp
  3. Refresh the NIS database maps using the make utility.
    # /usr/ccs/bin/make

If the NIS master is running the rpc.yppasswdd daemon, any client system can update the NIS password map by using the yppasswd or passwd commands, as shown in the image.

To update the password map complete the following steps:

  1. Run the rpc.yppasswdd daemon on the NIS master server
    # /usr/lib/netsvc/yp/rpc.yppasswdd /$PWDIR/passwd -m passwd

    When users change their NIS passwords, the rpc.yppasswdd daemon updates the NIS master’s /$PWDIR/passwd file and passwd map. The passwd map is then pushed to all slave servers.

  2. Enter the passwd command on any NIS client.
    $ passwd
    Changing NIS password for user1 on server1.
    Old password:
    New password:
    Retype new password:
    NIS entry changed on server1

The following steps manually update the NIS timezone map on the master server and propagate all maps to the slave servers:

  1. Edit the source file on the NIS master.
    # vi /etc/timezone
  2. Remake and push the NIS maps to the slave servers.
    # cd /var/yp; /usr/ccs/bin/make 
    1. If the push from the master server fails, the following command runs on the slave server and manually “pulls” only the timezone map from the master server.
      # /usr/lib/netsvc/yp/ypxfr timezone.byname
    2. To pull all of the maps from the master server at once, perform the command:
      # ypinit -s nis_master

Sometimes maps fail to propagate, and you must manually use the ypxfr command to retrieve new map information. To automate the updating and propagating of NIS maps on slave servers, you can install shell scripts to run as cron jobs. Because maps have different rates of change, scheduling a map transfer by using the crontab command enables you to set specific propagation intervals for individual maps.

The Solaris OS provides several template scripts in the /usr/lib/netsvc/yp directory that you can use and modify to meet your local site requirements. These scripts are useful when slave servers are down during NIS map propagations.

The image shows you how to update passwd maps using slave servers with scripts. When slave servers are down, they might not receive the update unless you run a “safety valve” script.

Using the ypxfr_1perhour Script

The following text lists the contents of the ypxfr_1perhour script that, if run hourly using the cron daemon, ensures that the NIS slave server’s passwd map is never more than one hour out of date.

#! /bin/sh
#
# Copyr 1990 Sun Microsystems, Inc.  
#ident  “@(#)ypxfr_1perhour.sh  1.2     00/05/01 SMI”
#
# ypxfr_1perhour.sh - Do hourly NIS map check/updates
#
PATH=/bin:/usr/bin:/usr/lib/netsvc/yp:$PATH
export PATH
# set -xv
ypxfr passwd.byname
ypxfr passwd.byuid 

Using the ypxfr_1perday Script

The following output details the contents of the ypxfr_1perday script. If run daily using the cron daemon, the script ensures that the NIS slave server’s NIS maps for the group, protocols, networks, services, and ypservers keys are never more than one day out of date.

#! /bin/sh
#
# Copyr 1990 Sun Microsystems, Inc.  
#ident  “@(#)ypxfr_1perday.sh   1.2     00/05/01 SMI”
#
# ypxfr_1perday.sh - Do daily NIS map check/updates
#
PATH=/bin:/usr/bin:/usr/lib/netsvc/yp:$PATH
export PATH
# set -xv
ypxfr group.byname
ypxfr group.bygid 
ypxfr protocols.byname
ypxfr protocols.bynumber
ypxfr networks.byname
ypxfr networks.byaddr
ypxfr services.byname
ypxfr ypservers

Using the ypxfr_2perday Script

The following output details the contents of the ypxfr_2perday script. If run twice daily using the cron daemon, the script ensures that the NIS slave server’s NIS maps for the hosts, ethers, netgroups keys, and mail aliases are never more than 12 hours out of date.

#! /bin/sh
#
# Copyr 1990 Sun Microsystems, Inc.  
#ident  “@(#)ypxfr_2perday.sh   1.2     00/05/01 SMI”
#
# ypxfr_2perday.sh - Do twice-daily NIS map check/updates
#
PATH=/bin:/usr/bin:/usr/lib/netsvc/yp:$PATH
export PATH
# set -xv
ypxfr hosts.byname
ypxfr hosts.byaddr
ypxfr ethers.byaddr
ypxfr ethers.byname
ypxfr netgroup
ypxfr netgroup.byuser
ypxfr netgroup.byhost
ypxfr mail.aliases 
Buy Abana
Buy Abilify
Buy Acai
Buy Accupril
Buy Accutane
Buy Aceon
Buy Aciphex
Buy Acomplia
Buy Acticin
Buy Actonel
Buy Actoplus Met
Buy Actos
Buy Adalat
Buy Advair
Buy Aldactone
Buy Aleve
Buy Allegra
Buy Alpha Lipoic Acid
Buy Altace
Buy Amaryl
Buy Amoxil
Buy Anacin
Buy Anafranil
Buy Ansaid
Buy Antabuse
Buy Arava
Buy Aricept
Buy Arimidex
Buy Aristocort
Buy Ashwagandha
Buy Astelin
Buy Atacand
Buy Atarax
Buy Atrovent
Buy Augmentin
Buy Avalide
Buy Avandamet
Buy Avandia
Buy Avapro
Buy Avodart
Buy Azulfidine
Buy Baclofen
Buy Bactrim
Buy Bactroban
Buy Beconase
Buy Benadryl
Buy Benfotiamine
Buy Benicar
Buy Bentyl
Buy Betnovate
Buy Breast Augmentation
Buy Breast Enhancement
Buy Buspar
Buy Bust Enhancer
Buy Cafergot
Buy Calan
Buy Calcium Carbonate
Buy Capoten
Buy Carafate
Buy Cardizem
Buy Cardura
Buy Casodex
Buy Ceftin
Buy Celadrin
Buy Celebrex
Buy Celexa
Buy Cephalexin
Buy Cha De Bugre
Buy Cheap Viagra
Buy Cheap Viagra Online
Buy Cialis
Cialis Buy Online Now
Cialis Cheap
Cialis Discount
Cialis Online Here
Cialis Order
Buy Cialis Soft Tabs
Buy Cipro
Buy Clarinex
Buy Claritin
Buy Cleocin
Buy Clomid
Buy Clonidine
Buy Colchicine
Buy Colostrum
Buy Combivent
Buy Copegus
Buy Coq10
Buy Coral Calcium
Buy Cordarone
Buy Coreg
Buy Coumadin
Buy Cozaar
Buy Creatine
Buy Crestor
Buy Cymbalta
Buy Cystone
Buy Cytotec
Buy Cytoxan
Buy Danazol
Buy Decadron
Buy Deltasone
Buy Depakote
Buy Desyrel
Buy Detrol
Buy Diamox
Buy Diclofenac
Buy Didronel
Buy Differin
Buy Diflucan
Buy Diovan
Buy Discount Viagra
Buy Ditropan
Buy Dostinex
Buy Doxycycline
Buy Dramamine
Buy Dulcolax
Buy Echinacea
Buy Effexor
Buy Elavil
Buy Elimite
Buy Emsam
Buy Endep
Buy Epivir
Buy Erexin
Buy Erexor
Buy Erythromycin
Buy Eurax
Buy Evegen
Buy Evista
Buy Exelon
Buy Extendaquin
Buy Extreme Detox
Buy Famvir
Buy Feldene
Buy Female Viagra
Buy Femara
Buy Femcare
Buy Flagyl
Buy Flomax
Buy Flonase
Buy Fosamax
Buy Free Viagra
Buy French Red Wine
Buy Fucidin
Buy Furosemide
Generic Viagra
Buy Geodon
Buy Ginseng
Buy Glucophage
Buy Glucosamine Sulfate
Buy Glucotrol
Buy Grifulvin
Buy Hair Loss Cream
Buy Haldol
Buy Head Strong
Buy Herbal Testosterone
Buy Hoodia
Buy Hyaluronic Acid
Buy Hyzaar
Buy Imitrex
Buy Lamisil
Buy Lasix
Buy Levaquin
Buy Levitra
Buy Levothroid
Buy Lexapro
Buy Lipitor
Buy Lisinopril
Buy Lotensin
Buy Lotrisone
Buy Mircette
Buy Motrin
Buy Naprosyn
Buy Neurontin
Buy Nexium
Buy Nicotine
Buy Nizoral
Buy Norvasc
Buy Ortho
Buy Paxil
Buy Penis Pill
Buy Phenergan
Buy Phentermine
Buy Phentermine Online
Buy Plavix
Buy Plendil
Buy Pravachol
Buy Prednisone
Buy Premarin
Buy Prevacid
Buy Prilosec
Buy Prinivil
Buy Propecia
Buy Proscar
Buy Protonix
Buy Prozac
Buy Relafen
Buy Remeron
Buy Retin
Buy Risperdal
Buy Sarafem
Buy Serevent
Buy Seroquel
Buy Singulair
Buy Skelaxin
Buy Soma
Buy Synalar
Buy Synthroid
Buy Tazorac
Buy Toprol
Buy Tramadol
Buy Tricor
Buy Trimox
Buy Triphasil
Buy Ultracet
Buy Ultram
Buy Valtrex
Buy Vasotec
Buy Vermox
Buy Viagra
Viagra Buy Online Now
Viagra Cheap
Viagra Discount
Viagra Online Here
Viagra Order
Viagra Soft Tabs
Buy Wellbutrin
Buy Zanaflex
Buy Zestoretic
Buy Zestril
Buy Zithromax
Buy Zocor
Buy Zoloft
Buy Zovirax
Buy Zyban
Buy Zyloprim
Buy Zyprexa
Buy Zyrtec

Related Posts: