Configuring the Network Information Service (NIS)

Modifying map attributes

Attributes include the following:

See also:

Viewing timestamp

Each NIS map includes a timestamp that indicates when the map was built. Viewing this timestamp can be valuable when troubleshooting.

This timestamp is used by NIS programs such as ypxfr on a copy-only server to compare its map versions with those on a master. If the master version has a newer timestamp, the newer version is retrieved.

It may be useful to view this timestamp to ensure synchronization of maps. This timestamp is readable as a string whose value is the standard UNIX system timestamp (seconds since 1970). If this value on a map on a copy-only server is less than that on the map on the master server, the master is newer and hasn't been transferred. If the value on the copy-only server is larger than the master, it may reveal that a bogus master exists somewhere that is updating nonmaster servers.

To view the timestamp, enter:

   ypmatch YP_LAST_MODIFIED mapname
The date is displayed as:
   YP_LAST_MODIFIED : 0736625147

See also:

Modifying map names and aliases

Because of file naming conventions, names of existing NIS maps may conflict with names you want to use for another map or another file. To avoid conflicts, you can assign an alias. If this does not work, use a different name for the newer file to avoid having to change the name of an existing map.

If you must change the name of an existing map, follow this procedure:

  1. Create and propagate a map with the new name.

  2. Add the new name to the YP_MAP_X_LATE file on all NIS servers.

  3. If you are not going to use the old name for a different NIS map, remove the old name from the YP_MAP_X_LATE file on all NIS servers and remove the old map from all NIS servers.

    If you are going to use the old name for a different NIS map, remove the old map from the master server; create and propagate the new map, using the old name. You will not need to add the name to the YP_MAP_X_LATE files on all NIS servers because it is already there.

NOTE: If you change a map name or map alias, you must change it in all YP_MAP_X_LATE files.

See also:

Synchronizing servers

If you recall from ``Using cron to propagate maps'', you can run ypxfr from a crontab file to update maps on a regular schedule. This should be set up to ensure that all NIS servers within an NIS domain are synchronized (using the same map, the most current one). The schedule with which a map is updated will depend on how frequently the map is expected to change.

If the frequency of updates to a map changes, change the frequency with which the map is updated by the crontab file. The example files provided are set up to group updates in the same time frequency. To change the frequency with which a map is updated, move its ypxfr entry to a crontab file with a frequency closer to that needed or create a new crontab file if an existing one does not fit.

For example, the following crontab entry will update a map once a day:

   0    0    *    *    *    /etc/yp/ypxfr1pdy
To have cron update the map twice a day instead of once a day, change the map's crontab entry to read as follows:
   0    0,12 *    *    *    /etc/yp/ypxfr2pdy

See also:

Next topic: Retrieving maps from the master server
Previous topic: Modifying the map list

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003