diff options
author | wpaul <wpaul@FreeBSD.org> | 1996-04-28 04:38:52 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1996-04-28 04:38:52 +0000 |
commit | 0f95e4e2267a1ba84724a850c3e16f8a4797df56 (patch) | |
tree | 8a812c67e9e63f836246125cbbd49d43a685fe54 /usr.sbin/ypserv/Makefile.yp | |
parent | 7431f827c29811064979692b6ff8740ff529e54b (diff) | |
download | FreeBSD-src-0f95e4e2267a1ba84724a850c3e16f8a4797df56.zip FreeBSD-src-0f95e4e2267a1ba84724a850c3e16f8a4797df56.tar.gz |
Performance enhancements (I hope) and new stuff:
yp_dblookup.c:
- Implement database handle caching. What this means is that instead
of opening and closing map databases for each request, we open a
database and save the handle (and, if requested, the key index)
in an array. This saves a bit of overhead on things like repeated
YPPROC_NEXT calls, such as you'd get from getpwent(). Normally,
each YPPROC_NEXT would require open()ing the database, seeking
to the location supplied by the caller (which is time consuming with
hash databases as the R_CURSOR flag doesn't work), reading the
data, close()ing the database and then shipping the data off to
the caller. The system call overhead is prohibitive, especially
with very large maps. By caching the handle to an open database,
we elimitate at least the open()/close() system calls, as well
as the associated DB setup and tear-down operations, for a large
percentage of the time. This improves performance substantially at
the cost of consuming a little more memory than before.
Note that all the caching support is surrounded by #ifdef DB_CACHE
so that this same source module can still be used by other programs
that don't need it.
- Make yp_open_db() call yp_validdomain(). Doing it here saves cycles
when caching is enabled since a hit on the map cache list by
definition means that the domain being referenced is valid.
- Also make yp_open_db() check for exhaustion of file descriptors,
just in case.
yp_server.c:
- Reorganize things a little to take advantage of the database
handle caching. Add a call to yp_flush_all() in ypproc_clear_2_svc().
- Remove calls to yp_validdomain() from some of the service procedures.
yp_validdomain() is called inside yp_open_db() now, so procedures that
call into the database package don't need to use yp_validdomain()
themselves.
- Fix a bogosity in ypproc_maplist_2_svc(): don't summarily initiallize
the result.maps pointer to NULL. This causes yp_maplist_free()
to fail and leaks memory.
- Make ypproc_master_2_svc() copy the string it gets from the database
package into a private static buffer before trying to NUL terminate it.
This is necessary with the DB handle caching: stuffing a NUL into the
data returned by DB package will goof it up internally.
yp_main.c:
- Stuff for DB handle caching: call yp_init_dbs() to clear the
handle array and add call to yp_flush_all() to the SIGHUP
signal handler.
Makefile.yp:
- Reorganize to deal with database caching. yp_mkdb(8) can now be used
to send a YPPROC_CLEAR signal to ypserv(8). Call it after each map
is created to refresh ypserv's cache.
- Add support for mail.alias map.
Contributed by Mike Murphy (mrm@sceard.com).
- Make default location for the netgroups source file be /var/yp/netgroup
instead of /etc/netgroup.
mkaliases:
- New file: script to generate mail.alias map.
Contributed by Mike Murphy (mrm@sceard.com).
Makefile:
- Install Makefile.yp as /var/yp/Makefile.dist and link it to
/var/yp/Makefile only if /var/yp/Makefile doesn't already exist.
Suggested by Peter Wemm.
- Install new mkaliases script in /usr/libexec along with mknetid.
- Use somewhat saner approach to generating rpcgen-dependent files
as suggested by Garrett Wollman.
Diffstat (limited to 'usr.sbin/ypserv/Makefile.yp')
-rw-r--r-- | usr.sbin/ypserv/Makefile.yp | 184 |
1 files changed, 130 insertions, 54 deletions
diff --git a/usr.sbin/ypserv/Makefile.yp b/usr.sbin/ypserv/Makefile.yp index 198ffb7..bcb06d7 100644 --- a/usr.sbin/ypserv/Makefile.yp +++ b/usr.sbin/ypserv/Makefile.yp @@ -1,7 +1,7 @@ # # Makefile for the NIS databases # -# $Id: Makefile.yp,v 1.2 1996/01/12 07:07:18 wpaul Exp $ +# $Id: Makefile.yp,v 1.2 1996/04/13 21:17:57 wpaul Exp wpaul $ # # This Makefile should only be run on the NIS master server of a domain. # All updated maps will be pushed to all NIS slave servers listed in the @@ -36,11 +36,15 @@ NOPUSH = "True" # AWK = /usr/bin/awk RM = @/bin/rm -f +MV = @/bin/mv -f RCAT = /bin/cat CAT = @$(RCAT) +SED = /usr/bin/sed DBLOAD = /usr/sbin/yp_mkdb -m `hostname` MKNETID = /usr/libexec/mknetid +MKALIASES = /usr/libexec/mkaliases +NEWALIASES = /usr/bin/newaliases YPPUSH = /usr/sbin/yppush .if !defined(UPDATE_DOMAIN) DOMAIN = `/bin/domainname` @@ -48,7 +52,13 @@ DOMAIN = `/bin/domainname` DOMAIN = $(UPDATE_DOMAIN) .endif REVNETGROUP = /usr/libexec/revnetgroup +NFILE = /tmp/ypmake +TMP = `$(RCAT) $(NFILE)` +# It is advisable to create a seperate directory to contain the +# source files used to generate your NIS maps. If you intent to +# support multiple domains, something like /src/dir/$DOMAIN +# would work well. YPSRCDIR = /etc YPDIR = /var/yp YPMAPDIR = $(YPDIR)/$(DOMAIN) @@ -82,7 +92,8 @@ PROTOCOLS = $(YPSRCDIR)/protocols RPC = $(YPSRCDIR)/rpc SERVICES = $(YPSRCDIR)/services GROUP = $(YPSRCDIR)/group -NETGROUP = $(YPSRCDIR)/netgroup +ALIASES = $(YPSRCDIR)/aliases +NETGROUP = $(YPDIR)/netgroup PASSWD = $(YPDIR)/passwd .if !defined(MASTER_PASSWD) MASTER = $(YPDIR)/master.passwd @@ -93,6 +104,7 @@ YPSERVERS = $(YPDIR)/ypservers # List of all NIS servers for a domain PUBLICKEY = $(YPSRCDIR)/publickey target: + @$(RM) $(NFILE) @if [ ! -d $(DOMAIN) ]; then mkdir $(DOMAIN); fi; \ cd $(DOMAIN) ; echo "NIS Map update started on `date` for domain $(DOMAIN)" ; \ make -f ../Makefile all; echo "NIS Map update completed." @@ -104,8 +116,8 @@ target: # on all systems. # -all: master.passwd passwd hosts group networks protocols \ - rpc services servers netid # publickey netgroup ethers bootparam +all: master.passwd passwd hosts group networks protocols rpc \ + services servers netid # aliases publickey netgroup ethers bootparam ethers: ethers.byname ethers.byaddr bootparam: bootparams @@ -120,59 +132,84 @@ netgrp: netgroup netid: netid.byname servers: ypservers publickey: publickey.byname +aliases: mail.aliases master.passwd: master.passwd.byname master.passwd.byuid +mail.aliases: $(ALIASES) + @echo "Updating $@..." + @echo $@.$$$$ > $(NFILE) + $(CAT) $(ALIASES) | \ + $(SED) -e "/^#/d" -e s/#.*$$// -e "/^ *$$/d" |\ + $(MKALIASES) \ + | $(DBLOAD) -i $(ALIASES) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c + @$(NEWALIASES) + @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi + @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi + ypservers: $(YPSERVERS) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(YPSERVERS) | \ $(AWK) '{ if ($$1 != "" && $$1 != "#") print $$0"\t"$$0 }' $^ \ - | $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $@ + | $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi + ethers.byname: $(ETHERS) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(ETHERS) | \ $(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \ print $$2"\t"$$0 }' $^ | $(DBLOAD) -i $(ETHERS) \ - -o $(YPMAPDIR)/$@ - $@ + -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) -i $(ETHERS) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi ethers.byaddr: $(ETHERS) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(ETHERS) | \ $(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \ print $$1"\t"$$0 }' $^ | $(DBLOAD) -i $(ETHERS) \ - -o $(YPMAPDIR)/$@ - $@ + -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi bootparams: $(BOOTPARAMS) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(BOOTPARAMS) | \ $(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \ print $$0 }' $^ | $(DBLOAD) -i $(BOOTPARAMS) \ - -o $(YPMAPDIR)/$@ - $@ + -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi netgroup: $(NETGROUP) netgroup.byhost netgroup.byuser @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(NETGROUP) | \ $(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \ print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \ - -o $(YPMAPDIR)/$@ - $@ + -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi @$(MAKE) -f ../Makefile netid @@ -180,43 +217,52 @@ netgroup: $(NETGROUP) netgroup.byhost netgroup.byuser netgroup.byhost: $(NETGROUP) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(NETGROUP) | $(REVNETGROUP) -h -f $(NETGROUP) | \ $(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \ print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \ - -o $(YPMAPDIR)/$@ - $@ + -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi netgroup.byuser: $(NETGROUP) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(NETGROUP) | $(REVNETGROUP) -u -f $(NETGROUP) | \ $(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \ print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \ - -o $(YPMAPDIR)/$@ - $@ + -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi hosts.byname: $(HOSTS) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(HOSTS) | \ $(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "#"; n++) \ print $$n"\t"$$0 }' $^ | $(DBLOAD) -i $(HOSTS) \ - -o $(YPMAPDIR)/$@ - $@ + -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi @$(MAKE) -f ../Makefile netid + hosts.byaddr: $(HOSTS) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(HOSTS) | \ $(AWK) '$$1 !~ "#" { print $$1"\t"$$0 }' $^ \ - | $(DBLOAD) -i $(HOSTS) -o $(YPMAPDIR)/$@ - $@ + | $(DBLOAD) -i $(HOSTS) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi @$(MAKE) -f ../Makefile netid @@ -224,99 +270,114 @@ hosts.byaddr: $(HOSTS) networks.byname: $(NETWORKS) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(NETWORKS) | \ $(AWK) \ '$$1 !~ "#" { print $$1"\t"$$0; \ for (n=3; n<=NF && $$n !~ "#"; n++) \ print $$n"\t"$$0 \ - }' $^ | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $@ + }' $^ | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi networks.byaddr: $(NETWORKS) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(NETWORKS) | \ $(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \ - | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $@ + | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi protocols.byname: $(PROTOCOLS) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(PROTOCOLS) | \ $(AWK) \ '$$1 !~ "#" { print $$1"\t"$$0; \ for (n=3; n<=NF && $$n !~ "#"; n++) \ print $$n"\t"$$0 \ }' $^ | $(DBLOAD) -i $(PROTOCOLS) \ - -o $(YPMAPDIR)/$@ - $@ + -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi protocols.bynumber: $(PROTOCOLS) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(PROTOCOLS) | \ $(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \ - | $(DBLOAD) -i $(PROTOCOLS) -o $(YPMAPDIR)/$@ - $@ + | $(DBLOAD) -i $(PROTOCOLS) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi rpc.byname: $(RPC) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(RPC) | \ $(AWK) \ '$$1 !~ "#" { print $$1"\t"$$0; \ for (n=3; n<=NF && $$n !~ "#"; n++) \ print $$n"\t"$$0 \ - }' $^ | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $@ + }' $^ | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi rpc.bynumber: $(RPC) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(RPC) | \ $(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \ - | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $@ + | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi services.byname: $(SERVICES) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(SERVICES) | \ $(AWK) \ '$$1 !~ "#" { if (index($$2,"udp")) { printf("%s/udp",$$1) } \ else { printf("%s/tcp",$$1) }; print "\t"$$0 \ - }' $^ | $(DBLOAD) -i $(SERVICES) -o $(YPMAPDIR)/$@ - $@ + }' $^ | $(DBLOAD) -i $(SERVICES) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi publickey.byname: $(PUBLICKEY) @echo "Updating $@..." - $(RM) $@ - $(CAT) $(PUBLICKEY) | \ + @echo $@.$$$$ > $(NFILE) + $(TMP) = `$(RCAT) $(NFILE)` $(AWK) '$$1 !~ "#" { print $$1"\t"$$2 }' $^ \ - | $(DBLOAD) -i $(PUBLICKEY) -o $(YPMAPDIR)/$@ - $@ + | $(DBLOAD) -i $(PUBLICKEY) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi $(PASSWD): $(MASTER) @echo "Creating new $@ file from $(MASTER)..." - $(RM) $@ @if [ ! $(UNSECURE) ]; then \ $(RCAT) $(MASTER) | \ $(AWK) -F: '{if ($$1 != "+") \ @@ -330,19 +391,24 @@ $(PASSWD): $(MASTER) passwd.byname: $(PASSWD) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(PASSWD) | \ $(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \ - | $(DBLOAD) -i $(PASSWD) -o $(YPMAPDIR)/$@ - $@ + | $(DBLOAD) -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi + passwd.byuid: $(PASSWD) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(PASSWD) | \ $(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \ - | $(DBLOAD) -i $(PASSWD) -o $(YPMAPDIR)/$@ - $@ + | $(DBLOAD) -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi @$(MAKE) -f ../Makefile netid @@ -350,20 +416,24 @@ passwd.byuid: $(PASSWD) group.byname: $(GROUP) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(GROUP) | \ $(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \ - | $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@ + | $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi group.bygid: $(GROUP) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(GROUP) | \ $(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \ - | $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@ + | $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi @$(MAKE) -f ../Makefile netid @@ -371,28 +441,34 @@ group.bygid: $(GROUP) netid.byname: $(GROUP) $(PASSWD) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) @$(MKNETID) $(PASSWD) $(GROUP) `basename \`pwd\`` \ - | $(DBLOAD) -o $(YPMAPDIR)/$@ - $@ + | $(DBLOAD) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi master.passwd.byname: $(MASTER) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(MASTER) | \ $(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \ - | $(DBLOAD) -i $(MASTER) -o $(YPMAPDIR)/$@ - $@ + | $(DBLOAD) -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi master.passwd.byuid: $(MASTER) @echo "Updating $@..." - $(RM) $@ + @echo $@.$$$$ > $(NFILE) $(CAT) $(MASTER) | \ $(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \ - | $(DBLOAD) -i $(MASTER) -o $(YPMAPDIR)/$@ - $@ + | $(DBLOAD) -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP) + @$(MV) $(TMP) $@ + @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi |