|YPSERV(8)||Maintenance Commands and Procedures||YPSERV(8)|
/usr/lib/netsvc/yp/ypserv [-dv] [-i | -I] [-r | -R]
The ypserv utility is a daemon process typically activated at system startup from svc:/network/nis/server:default. Alternatively, you can, as the root user, start NIS services using ypstart(8) from the command-line. ypserv runs only on NIS server machines with a complete NIS database. You can halt all NIS services using the ypstop(8) command.
The ypxfrd utility transfers entire NIS maps in an efficient manner. For systems that use this daemon, map transfers are 10 to 100 times faster, depending on the map. To use this daemon, be sure ypxfrd is running on the master server. See /usr/lib/netsvc/yp/ypstart. ypxfr attempts to use ypxfrd first. If that fails, it prints a warning, then uses the older transfer method.
The ypserv daemon's primary function is to look up information in its local database of NIS maps.
The operations performed by ypserv are defined for the implementor by the YP Protocol Specification, and for the programmer by the header file <rpcsvc/yp_prot.h>.
Communication to and from ypserv is by means of RPC calls. Lookup functions are described in ypclnt(3NSL), and are supplied as C-callable functions in the libnsl(3LIB) library. There are four lookup functions, all of which are performed on a specified map within some NIS domain: yp_match(3NSL), yp_first(3NSL), yp_next(3NSL), and yp_all(3NSL). The yp_match operation takes a key, and returns the associated value. The yp_first operation returns the first key-value pair from the map, and yp_next can be used to enumerate the remainder. yp_all ships the entire map to the requester as the response to a single RPC request.
A number of special keys in the DBM files can alter the way in which ypserv operates. The keys of interest are:
Two other functions supply information about the map, rather than map entries: yp_order(3NSL), and yp_master(3NSL). In fact, both order number and master name exist in the map as key-value pairs, but the server will not return either through the normal lookup functions. If you examine the map with makedbm(8), however, they are visible. Other functions are used within the NIS service subsystem itself, and are not of general interest to NIS clients. These functions include do_you_serve_this_domain?, transfer_map, and reinitialize_internal_state.
On start up, ypserv checks for the existence of the NIS to LDAP (N2L) configuration file /var/yp/NISLDAPmapping. If it is present then a master server starts in N2L mode. If the file is not present it starts in "traditional" (non N2L) mode. Slave servers always start in traditional mode.
In N2L mode, a new set of map files, with an LDAP_ prefix, are generated, based on the contents of the LDAP DIT. The old map files, NIS source files and ypmake(8) are not used.
It is possible that ypmake(8) can be accidentally run in N2L mode. If the occurs, the old style map files are overwritten. That the map files are overwritten is harmless. However, any resulting yppush(8) operation will push information based on the DIT rather than the source files. The user may not expect information based on the DIT. ypserv keeps track of the last modification date of the old style map files. If the map files have been updated, a warning is logged that suggests that the user call yppush directly instead of ypmake.
If a server attempts to run in N2L mode and a LDAP server cannot be contacted, it behaves as follows:
If ypxfrd is running in N2L mode and is asked to transfer a map, ypxfrd first checks whether the map is out of date. If the map is out of date, ypxfrd initiates an update from the DIT. ypxfrd cannot wait for the update to complete. If ypxfrd waited, the client end ypxfr operation could time out. To prevent ypxfrd from timing out, the existing map is transferred from the cache. The most up to date map will be transferred on subsequent ypxfrd operations.
The -i option does not attempt to create any NIS domain or container objects. If any NIS domain or container objects have not already been created, then errors will occur, as entries are written to nonexistent containers.
When run with the -i, -r, -I, -ir or -Ir options, the ypserv command runs in the foreground and exits once map initialization has been completed. Once the ypserv command exits, the user knows the maps are ready and can restart ypserv and the other yp daemons by running ypstart(8).
If there is a requirement to initialize the DIT from the NIS source files, which may have been modified since the maps were last remade, run ypmake before running ypserv -i or ypserv -ir. ypmake regenerated old style NIS maps. Then ypserv -ir dumps them into the DIT. When the -ir option is used, the LDAP_ prefixe maps are also generated or updated. Since these maps will be more recent than the old style maps, ypmake will not be reported as erroneous when it is run.
The Network Information Service (NIS) was formerly known as Sun Yellow Pages (YP). The functionality of the two remains the same; only the name has changed. The name Yellow Pages is a registered trademark in the United Kingdom of British Telecommunications PLC, and must not be used without permission.
NIS uses ndbm() files to store maps. Therefore, it is subject to the 1024 byte limitations described in the USAGE and NOTES sections of the ndbm(3C) man page.
The NIS server service is managed by the service management facility, smf(7), under the service identifier:
|December 15, 2004||OmniOS|