Copyright (C) 1997 Florian La Roche


General things about yp:
========================

Some files can be distributed over the network and you only have to
modify one file on a server machine to add new entries.

Most people use this just for /etc/passwd, /etc/shadow and /etc/group.
Some people even use it for /etc/hosts and /etc/services.

The yp-server and also the yp-client-program "ypbind" need a running
"portmap". If your portmapper has the tcp-wrapper builtin, make sure
/etc/hosts.allow and /etc/hosts.deny are setup correctly.

The rc.config variables for YP could be find in /etc/rc.config and
/etc/rc.config.d/ypserv.rc.config


Installing a client machine:
============================

The client and the server machines need to choose a common domainname.
It can be any fantasy name you want and needn't be a DNS domainname.

Edit /etc/rc.config and put this domainname into YP_DOMAINNAME.
If you don't want to reboot, just run "domainname <ypdomainname>"
as root now.

Give a list of available yp servers in YP_SERVER in /etc/rc.config.
If you run /sbin/SuSEconfig, these will be written to /etc/yp.conf
(the configuration file of ypbind).

You can now start ypbind ("rcypclient start").
ypbind holds a connection to the yp-server. All progs on your client-machine
will ask ypbind for things from the yp-server.

"ypwhich" will give you the name of the server ypbind is currently connected
to. "ypwhich -m" will give you a listing of all currently available maps.
"ypcat <mapname>" will output that map on your screen.

To enable adding further entries from the yp-server to your local /etc/passwd,
you have to append a line "+" at the end of the /etc/passwd. Do the same
for /etc/group.

To enable using /etc/hosts from the yp-server, you have to use a line
"order hosts nis bind" in /etc/host.conf. I would not recommend to
do this. It is much better to configure a real DNS-server for this.


Installing a master server:
===========================

Configure your domainname just like above for a client machine.

Configure your machine just like in the client-case for the server "localhost":
Choose a domainname and set YP_SERVER to localhost.

Here are the two possibilities to generate the database files (maps) on the
server together with the needed crontab-entries in /etc/crontab:
- edit /var/yp/Makefile and run "cd /var/yp; make". The crontab entry is:
       */10 * * * * root make -s -C /var/yp
- run the perl-script "ypmake". The crontab entry is:
       */10 * * * * root cd /var/yp && ypmake > /dev/null

On bootup, you should start ypserv and rpc.yppasswd (used for changing
passwords with yppasswd).

If you want to have slave servers, you have to edit /var/yp/Makefile
and list the slave servers in /var/yp/ypservers. You should also start
rpc.ypxfrd to have a faster transfer of the maps.


Installing a slave server:
==========================

Setup everything for a normal client machine. Add "localhost" at the
end of YP_SERVERS (this will be the first machine to contact).

Start ypbind to have a working connection to the main yp-server.

Start "/usr/sbin/ypslave init" to transfer all maps to the local server.
(This programm is only a small shell script. Read it.)
You can now start the yp-server ("rcypserv start") and restart ypbind to
use localhost ("rcypclient start").

On bootup you should first start ypserv and then ypbind.
To regularely check if we have missed fetching a new map, add the following
line to /etc/crontab:
51 * * * * root /usr/sbin/ypslave 2>/dev/null

Also add this host to /var/yp/ypservers on the yp server and enable
pushing of new maps to this slave server. Whenever a new map is
generated on the server, it will call "yppush". "yppush" will connect
all slave servers, which will in turn call "ypxfr" to update their
maps. That simple :-)
