SUMMARY: NIS ypservers map

From: Theo Wawers / ZD (zdtwa@lif.de)
Date: Mon Jul 25 1994 - 16:27:23 CDT


Thanks to all who helped solve the problem:

Ian MacPhedran <Ian_MacPhedran@engr.usask.ca>
gdonl@gv.ssi1.com (Don Lewis)
Mike Raffety <mike_raffety@il.us.swissbank.com>
andrew@mdlhk.attmail.com (Andrew Law)
Stefan Turowski <Stefan.Turowski@informatik.uni-erlangen.de>
Markus Storm <storm@uni-paderborn.de>
paulo@dcc.unicamp.br
zegarac@gdls.com (Dan Zegarac)
eddy@telecomm.tadiran.co.il (Edward Resnick - Sys Adm Team (1723))
stern@sunrise.East.Sun.COM (Hal Stern - NE Area Systems Engineer)

It turned out that the ypbind on the master server pointed to a slave server that didn't have the map. To avoid further problems I added an entry to the yp-makefile for the ypservers-map. I include all the answers I got at the end of this message.

Thanks again..

Theo
============================================================
original question:

Hi,

a while ago I added 3 NIS slave servers in our network. To transfer
maps to these servers, I had to add them to the ypservers map. So I
did, what Hal described in his book on page 25:

ypcat -k ypservers /tmp/ypservers
<edit map-add the 3 servernames in /tmp/ypservers
cat /tmp/ypservers|makedbm - /var/yp/`domainname`/ypservers

It didn't complain about that. But now I got strange effects:
1) If I do a
ypcat -k ypservers
I get
no such map in server's domain

and what is worse: If I edit /etc/hosts on the master and try to build
the new maps with: make hosts, I get:

# make hosts
updated hosts
Can't build server list from map "ypservers". Reason: unknown NIS client error code.
*** Error code 1
make: Fatal error: Command failed for target `hosts.time'

But on the other hand, the map seems to be there: in /var/yp/`domainname`:
ls -l ypservers*
-rw------- 1 root 0 Jul 14 09:34 ypservers.dir
-rw------- 1 root 1024 Jul 14 09:34 ypservers.pag

and

makedbm -u ypservers
gives:
YP_LAST_MODIFIED 0774171277
YP_MASTER_NAME master
master
slave1
slave2
slave3
slave3

Does anybody have suggestions what to do ? I would appreciate your help.

============================================================

Begin of answers:
============================================================

Return-Path: <Ian_MacPhedran@engr.usask.ca>
Date: Thu, 14 Jul 1994 15:04:55 -0600 (CST)
From: Ian MacPhedran <Ian_MacPhedran@engr.usask.ca>
Subject: Re: NIS map ypservers
To: Theo Wawers / ZD <zdtwa@lif.de>
In-Reply-To: <302r4p$d2a@nameserver.lif.de>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

On 14 Jul 1994, Theo Wawers / ZD wrote:

Theo;
Did you ypxfr the new ypservers map from all of the NIS slaves? Maybe it
doesn't exist on any but your master server.

Ian.
----------------------------------------------------------------------------
Ian MacPhedran, Engineering Computer Centre, University of Saskatchewan.
2B13 Engineering Building, U. of S. Campus, Saskatoon, Sask., CANADA S7N 0W0
Phone: (306)966-4832 Fax: (306)966-8710 Email: Ian_MacPhedran@engr.USask.CA

============================================================

Return-Path: <gdonl@gv.ssi1.com>
From: gdonl@gv.ssi1.com (Don Lewis)
Date: Thu, 14 Jul 1994 17:56:54 -0700
In-Reply-To: zdtwa@lif.de (Theo Wawers / ZD)
       "NIS map ypservers" (Jul 14, 7:57am)
X-Mailer: Mail User's Shell (7.2.4 2/2/92)
To: zdtwa@lif.de (Theo Wawers / ZD)
Subject: Re: NIS map ypservers

The problem is that ypbind on your NIS master server is bound to one of
the slave servers, and the ypservers map is not present on the slaves.
You should be able fix this by executing:
        /usr/etc/yp/ypxfr -h nismastername ypservers
on each of the slaves.

                        --- Truck

============================================================

Return-Path: <mike_raffety@il.us.swissbank.com>
Date: Thu, 14 Jul 94 18:38:55 CDT
From: Mike Raffety <mike_raffety@il.us.swissbank.com>
X-Organization: Swiss Bank Corporation
To: zdtwa@lif.de
Subject: Re: NIS map ypservers

You forgot to go to the slaves and ypxfr it over ...

============================================================

Return-Path: <andrew@mdlhk.attmail.com>
From: andrew@mdlhk.attmail.com (Andrew Law)
Date: 15 Jul 94 02:36:12 GMT
To: zdtwa@lif.de
Message-Service: mail
Subject: Re: NIS map ypservers
X-Sun-Charset: US-ASCII
Content-Type: text

Try add the following to your yp Makefile

all: passwd group hosts ethers networks rpc services protocols \
        .... ypservers

ypservers.time: $(DIR)/ypservers
        @(sed -e '/^#/d' -e s/#.*$$// -e 's/[ ][ ]*$$//' \
            -e '/\\$$/s/\\$$/ /' $(DIR)/ypservers $(CHKPIPE))\
        |( awk 'BEGIN { OFS="\t"; } $$1 !~ /^#/ {print $$0, $$0}' $(CHKPIPE))\
        |( sed -e 's/[ ][ ]*/ /g' $(CHKPIPE))\
        | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/ypservers;
        @touch ypservers.time;
        @echo "updated ypservers";
        @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) ypservers; fi
        @if [ ! $(NOPUSH) ]; then echo "pushed ypservers"; fi

ypservers: ypservers.time

Create the file /etc/ypservers with names of ypservers.

Brgs.
Andrew.

============================================================

Return-Path: <turo@immd4.informatik.uni-erlangen.de>
From: Stefan Turowski <Stefan.Turowski@informatik.uni-erlangen.de>
Date: Fri, 15 Jul 1994 10:28:54 +0200
To: zdtwa@lif.de
Subject: Re: NIS map ypservers
Newsgroups: info.sun-managers
References: <302r4p$d2a@nameserver.lif.de>

Looks like your master server has bound itself to one of the slaves and this
slave does not have a ypservers map.

Check for /var/yp/`domainname`/ypservers.{dir,pag} on the slaves being
there and up to date. If not, do a
'/usr/etc/yp/ypxfr -f -h master ypservers'
on the slave to force a transfer of the map.

Gruss,
Stefan Turowski
Universitaet Erlangen

============================================================

Return-Path: <storm@uni-paderborn.de>
From: Markus Storm <storm@uni-paderborn.de>
Date: Fri, 15 Jul 1994 13:24:19 +0200
To: zdtwa@lif.de
Subject: Re: NIS map ypservers
X-Sun-Charset: ISO-8859-1

Hmm ...
Die Standardmethode ist eigentlich das Editieren von /etc/ypservers auf
dem YP-Master und anschließendes make ypservers in /var/yp.

(Sollte der entsprechende Makefile-Eintrag fehlen: hier ist er :)

-----------------------

ypservers.time: $(DIR)/ypservers
        -@if [ -f $(DIR)/ypservers ]; then \
        sed -e "/^#/d" -e "s/#.*$$//" $(DIR)/ypservers \
                | awk '{for (i = 1; i<=NF; i++) print $$i, $$0}' \
                | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/ypservers; \
                touch ypservers.time; \
                echo "updated ypservers"; \
                if [ ! $(NOPUSH) ]; then \
                        $(YPPUSH) ypservers; \
                        echo "pushed ypservers"; \
                else \
                : ; \
                fi \
        else \
                echo "couldn't find $(DIR)/ypservers"; \
        fi

ypservers: ypservers.time

------------------------

Sollte dies nicht funktionieren, so könnte vorheriges Löschen von
/var/yp/`domainname`/ypservers.* helfen.

Allerletzter Ausweg ist ein neues ypinit -m auf dem Master (komplettes
Neuaufsetzen).

Gruß Markus

///////////////////////////////////////////////////////////////////
/ /
/ Markus Storm University of Paderborn /
/ storm@uni-paderborn.de Department of Mathematics /
/ SUN systems administration Warburger Straße 100 /
/ +49 (421) 60-2634 33095 Paderborn, Germany /
/ /
///////////////////////////////////////////////////////////////////

============================================================

Return-Path: <paulo@dcc.unicamp.br>
From: paulo@dcc.unicamp.br
Date: Fri, 15 Jul 94 05:26:01 EST
To: zdtwa@lif.de (Theo Wawers / ZD)
Subject: NIS map ypservers
Newsgroups: comp.sys.sun.admin,info.sun-managers
In-Reply-To: <302r4p$d2a@nameserver.lif.de>
References: <302r4p$d2a@nameserver.lif.de>

Forget about adding another server or adding another map following any
procedures. The only thing that works for me, and which is a lot
faster and trouble free, is to reinitialize NIS. Put down your
slaves, i.e. move /var/yp/domainname to somthing else, then ypinit -m
the master, then ypinit -s the slaves. I do it always in multi-user
and nobody seems to notice any side effects.

--
postmaster/manager
Paulo Licio de Geus			INTERNET: paulo@dcc.unicamp.br
Depto de Ciencia da Computacao		voice: +55 192 39-3115/8695/8442
DCC - IMECC - UNICAMP			fax: +55 192 39-7470/5808
caixa postal: 6065
13081-970  Campinas SP Brazil

============================================================

Return-Path: <zegarac@vcae05.gdls.com> Date: Fri, 15 Jul 94 08:14:52 EDT From: zegarac@gdls.com (Dan Zegarac) To: zdtwa@lif.de Subject: Re: NIS map ypservers

To fix this error, you need to check the /var/yp/Makefile. The following lines should be somewhere in your Makefile. Example: ################################### DIR =/etc DOM = `domainname` YPDBDIR=/var/yp MAKEDBM=$(YPDIR)/makedbm ypservers.time: $(DIR)/ypservers $(MAKEDBM) $(DIR)/ypservers $(YPDBDIR)/$(DOM)/ypservers; @touch ypservers.time; @echo "updated ypservers"; @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) ypservers; fi @if [ ! $(NOPUSH) ]; then echo "pushed ypservers"; fi

ypservers: ypservers.time

$(DIR)/ypservers: #################################### The makedbm command in the above example is looking for a file /etc/ypservers to recreate the map from. You should be able to copy the one you had in /tmp. I am not sure why you cannot read the map with ypcat.

Dan Zegarac Computer Sciences Corp. zegarac@gdls.com phone: (810) 825-5451 pager: (810) 610-4738

============================================================

Return-Path: <eddy@telecomm.tadiran.co.il> Date: Sun, 17 Jul 94 12:18:43 IDT From: eddy@telecomm.tadiran.co.il (Edward Resnick - Sys Adm Team (1723)) To: zdtwa@lif.de Subject: Re: NIS map ypservers

Hope you got an answer already, but if not ...

The lines in the ypservers table are wrong. I always use makedbm to alter this file

% makedbm -u ypservers > /tmp/yyy % vi /tmp/yyy % makedbm ypservers < /tmp/yyy

and the lines for each server should look like the following:

master master slave1 slave1 slave2 slave2 slave3 slave3

Hope this helps.

Edward Resnick, UNIX System Administration Team Tadiran Telecommunications Ltd., Israel

eddy@telecomm.tadiran.co.il eddy@applicom.co.il

============================================================

Return-Path: <stern@sunrise.East.Sun.COM> Date: Mon, 18 Jul 94 16:54:44 EDT From: stern@sunrise.East.Sun.COM (Hal Stern - NE Area Systems Engineer) To: zdtwa@lif.de Subject: Re: NIS map ypservers

did you push the map to the other servers, including the slaves? it's possible that you bound to one of your slave servers that doesn't have the map....

--hal

============================================================

--

======================================================================== Theo Wawers LAHMEYER INTERNATIONAL GMBH email : zdtwa@lif.de Lyonerstr. 22 phone : +49 69 66 77 639 D-60528 Frankfurt/Main fax : +49 69 66 77 571 Germany



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:09:06 CDT