NIS to LDAP Gateway and yppush
Hi,
I understand that when the N2L mode has been activated (via the existence of a NISLDAPmapping file in /var/yp), updates to the LDAP directory (Sun DS52) should automatically be pushed out to all slave clients when the N2L maps are being refreshed with ypserv -r. Is this correct or do I really have to call a yppush for every map that has changed?
Many thanks,
Michael
[474 byte] By [
MOJ] at [2007-11-25 22:41:30]

# 1
You will have to run yppush(1M) on the N2L master server to push the N2L maps to the slave servers OR run ypxfr(1M) on the slave servers to pull the maps. You will have to use crontab(1) to automatically perform these tasks.
A simple script as follows can be ran on the N2L server to yppush all maps to slave servers.
#--START SCRIPT--
#!/bin/ksh
DMN=`/bin/domainname`
if [ -d "/var/yp/$DMN" ]
then
for n2lmap in /var/yp/$DMN/LDAP_*_TTL.dir
do
map=`/usr/bin/basename $n2lmap _TTL.dir | cut -c 6-`
echo yppush -d $DMN $map
/usr/lib/netsvc/yp/yppush -d $DMN $map
echo $?
done
fi
#END SCRIPT
bk at 2007-7-5 14:18:28 >
