Return to BSD News archive
Newsgroups: comp.unix.bsd Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!decwrl!nic.hookup.net!swrinde!cs.utexas.edu!uunet!Germany.EU.net!news.dfn.de!tubsibr!petri From: petri@ibr.cs.tu-bs.de (Stefan Petri) Subject: Re: amd and YP Message-ID: <1994Jan24.151413.14287@ibr.cs.tu-bs.de> Sender: postnntp@ibr.cs.tu-bs.de (Mr. Nntp Inews Entry) Reply-To: petri@ibr.cs.tu-bs.de (Stefan Petri) Organization: TU Braunschweig, Informatik (Bueltenweg), Germany References: <1994Jan21.091651.7150@nmra.bioch.ox.ac.uk> Date: Mon, 24 Jan 1994 15:14:13 GMT Lines: 56 In article <1994Jan21.091651.7150@nmra.bioch.ox.ac.uk> mikes@bioch.ox.ac.uk (Mike Smith) writes: >How does one set up amd with yellow pages? I have a file with lines in like this: >nmrpcd host!=${key};type:=nfs;rhost:=${key};rfs:=/home/${key} \ > host==${key};type:=ufs;dev:=/dev/disk3 >but they come out like this with ypcat -k >nmrpcd host!=${key};type:=nfs;rhost:=${key};rfs:=/home/${key} host==${ >i.e. the returns get zapped. It seems that amd doesn't like this, so what am I >doing wrong? The entry in the Makefile looks like this: You should use the example yp-Makefile-entry that is given in the amd manual. It works for us :-) What it does besides stripping comments is, that a backslash-newline is removed (the newlines are zapped), together with _all leading_ white space on the next line. You should be able to just drop this entry into your Makefile. \begin{quote from the manual} When using NIS (formerly YP), an Amd map is implemented directly by the underlying NIS map. Comments and continuation lines are *not* supported in the automounter and must be stripped when constructing the NIS server's database. [..] $(YPTSDIR)/amd.home.time: $(ETCDIR)/amd.home -@sed -e "s/#.*$$//" -e "/^$$/d" $(ETCDIR)/amd.home | \ awk '{ \ for (i = 1; i <= NF; i++) \ if (i == NF) { \ if (substr($$i, length($$i), 1) == "\\") \ printf("%s", substr($$i, 1, length($$i) - 1)); \ else \ printf("%s\n", $$i); \ } \ else \ printf("%s ", $$i); \ }' | \ $(MAKEDBM) - $(YPDBDIR)/amd.home; \ touch $(YPTSDIR)/amd.home.time; \ echo "updated amd.home"; \ if [ ! $(NOPUSH) ]; then \ $(YPPUSH) amd.home; \ echo "pushed amd.home"; \ else \ : ; \ fi Here `$(YPTSDIR)' contains the time stamp files, and `$(YPDBDIR)' contains the dbm format NIS files. \end{quote}