While creating NIS master server on Solaris, with the default settings on a freshly installed system, I got the following error;
root@master# ypinit -m
In order for NIS to operate sucessfully, we have to construct a list of the
NIS servers. Please continue to add the names for YP servers in order of
preference, one per line. When you are done with the list, type a <control D>
or a return on a line by itself.
next host to add: master
next host to add:
The current list of yp servers looks like this:
master
Is this correct? [y/n: y] y
Installing the YP database will require that you answer a few questions.
Questions will all be asked at the beginning of the procedure.
Do you want this procedure to quit on non-fatal errors? [y/n: n] y
The yp domain directory is /var/yp/tps.local
Can we destroy the existing /var/yp/tps.local and its contents? [y/n: n] y
There will be no further questions. The remainder of the procedure should take
5 to 10 minutes.
Building /var/yp/tps.local/ypservers…
Running /var/yp /Makefile…
updated passwd
updated group
updated hosts
updated ipnodes
make: Warning: Don’t know how to make target `/etc/ethers’
Current working directory /var/yp
updated networks
updated rpc
updated services
updated protocols
make: Warning: Don’t know how to make target `/etc/netgroup’
Current working directory /var/yp
make: Warning: Don’t know how to make target `/etc/bootparams’
Current working directory /var/yp
/var/yp/tps.local/mail.aliases: 12 aliases, longest 10 bytes, 138 bytes total
/usr/lib/netsvc/yp/mkalias /var/yp/`domainname`/mail.aliases /var/yp/`domainname`/mail.byaddr;
updated aliases
updated publickey
updated netid
/usr/sbin/makedbm /etc/netmasks /var/yp/`domainname`/netmasks.byaddr;
updated netmasks
updated timezone
updated auto.master
updated auto.home
updated ageing
updated auth_attr
updated exec_attr
updated prof_attr
updated user_attr
updated audit_user
make: Warning: Target `all’ not remade because of errors
Current working directory /var/yp
*** Error code 1
The following command caused the error:
if [ ! 1 ]; then make -k all; \
else make -k all NOPUSH=1;fi
make: Fatal error: Command failed for target `k’
Error running Makefile.
Searching for the error on google was useless. Finally I found the cause of the problem.
make -k all, makes all targets i.e. maps.
If you follow the output, /etc/ethers, /etc/bootparamas, and /etc/netgroups do not exist, and thus make -k all fails because some targets did not complete. -k in make causes it to continue to non-dependent targets, if one target fails.
I did the following to fix this;
cp /var/yp/Makefile /var/yp/Makefile.orig
edit the Makefile
remove ethers, bootparams and netgroup from the target all.
ypinit -m again is then successful.