The
/usr/libexec/ypxfr
utility copies an
NIS
database (or
map
from one
NIS
server to another using
NIS
services.
In
Fx ,
/usr/libexec/ypxfr
is generally invoked by
ypserv(8)
when it receives a map transfer request from
yppush(8).
The
/usr/libexec/ypxfr
utility is used primarily in environments where several
NIS
servers are in use in a single domain.
One server, the
NIS
master, maintains
the canonical copies of all
NIS
maps, and all the other servers,
the
NIS
slaves, copy new versions of the maps from the master whenever
any updates are made (i.e., when a user updates their password via
yppasswd(1)).
When run,
/usr/libexec/ypxfr
creates a temporary database file in
/var/yp/[domainmame]
and fills it with the contents of
mapname
as supplied by the specified
source host
When the entire map has been transfered,
/usr/libexec/ypxfr
deletes the original copy of
mapname
and moves the temporary copy into its place.
When the transfer is
complete,
/usr/libexec/ypxfr
will attempt to send a 'clear current map' request to the local
ypserv(8)
process to clear any possible references it may still have to the
stale map.
Note that all files created by
/usr/libexec/ypxfr
are owner readable and writable only for security reasons.
Since the
NIS
maps and the directory in which they reside are normally owned by
root, this prevents non-privileged users from making unauthorized
modifications.
In order to maintain consistency across all
NIS
servers,
/usr/libexec/ypxfr
can be run periodically in a
cron(8)
job.
Maps which change infrequently
need only be updated once a day (preferably late at night when system
usage is lowest), whereas those that are subject to frequent changes
(such a
passwd.byname
and
passwd.byuid
should be updated perhaps once every hour.
Using
cron(8)
to automatically
update the
NIS
maps is not strictly mandatory since all updates should
be propagated by
yppush(8)
when
/var/yp/Makefile
is run on the
NIS
master server, however it is good practice
on large networks where possible outages could cause
NIS
servers to fall out of sync with each other.
When
/usr/libexec/ypxfr
is invoked without a controlling terminal, e.g. from inside
ypserv(8),
it logs all its output using the
syslog(3)
facility.
NOTES
The
Fx version of
/usr/libexec/ypxfr
has support for a special map transfer protocol which works in
conjunction with the
Fx rpc.ypxfrd8
server.
This protocol allows it to transfer raw map database files from
the
NIS
master server and can be many times faster than the standard
transfer method, particularly for very large
NIS
maps.
The
/usr/libexec/ypxfr
utility will check to see if the
rpc.ypxfrd8
server is registered on the
NIS
master server and attempt to use
it if it is present.
If it is not it will fall back to the standard
transfer method, copying the map contents from
ypserv(8)
and creating new maps instead.
Note that while the
Fx ypxfrd protocol is conceptually similar
to the SunOS ypxfrd protocol,
the
Fx protocol is not compatible with
Sun's, therefore it will not work with Sun's ypxfrd server.
Fx slave systems can still transfer maps from any
non- Fx NIS
server,
however they will only be able to take advantage of the faster protocol
if the master server is also running
Fx .
OPTIONS
The following options and flags are supported by
:
-f
Force a map transfer.
Normally,
/usr/libexec/ypxfr
will not transfer a map if it determines that the
NIS
master's copy
is not newer than the existing copy already on the local host: the
-f
flag forces a transfer regardless of which server's version is more recent.
-c
Do not send a 'clear current map' request to the
ypserv(8)
process running on the local host.
This flag is normally used when
invoking
/usr/libexec/ypxfr
manually on a machine that is not yet running
ypserv(8).
Without this flag, failure to contact the local
NIS
server will cause
/usr/libexec/ypxfr
to abort the transfer.
-d target domain
Specify a target domain other than the current
NIS
domain.
-h source host
Specify the name of the host from which to copy the
NIS
maps.
This option
is used to insure that
/usr/libexec/ypxfr
only copies maps from the
NIS
master server.
-s source domain
Specify the domain from which to transfer a map, in the event that
the transfer is being done across two different
NIS
domains.
-p path
Specify the top level directory containing the
NIS
maps.
By
default, this path is
/var/yp
The
-p
flag allows you to specify an alternate path should you wish to
store your
NIS
maps in a different part of the file system.
The
NIS
server,
ypserv(8),
passes this flag to
/usr/libexec/ypxfr
if it too has been told to use an alternate path.
-C taskid program-number ipaddr port
These options are used only when
/usr/libexec/ypxfr
is invoked by
ypserv(8)
in response to a map transfer request initiated by
yppush(8).
In this instance,
/usr/libexec/ypxfr
needs to 'callback' to the
yppush(8)
process and interact with it, so
yppush(8)
passes to it an IP address
ipaddr
port number
port
registered program number
program-number
and a transaction ID
taskid
that it can use to contact the waiting
yppush(8)
process on the master server.