SUMMARY: NIS map ypservers

From: Theo Wawers / ZD (
Date: Wed Jul 20 1994 - 07:16:57 CDT

Thanks to all who helped solve the problem:

Ian MacPhedran <> (Don Lewis)
Mike Raffety <> (Andrew Law)
Stefan Turowski <>
Markus Storm <> (Dan Zegarac) (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..

original question:


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


makedbm -u ypservers

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


Begin of answers:

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

On 14 Jul 1994, Theo Wawers / ZD wrote:

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 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: <>
From: (Don Lewis)
Date: Thu, 14 Jul 1994 17:56:54 -0700
In-Reply-To: (Theo Wawers / ZD)
       "NIS map ypservers" (Jul 14, 7:57am)
X-Mailer: Mail User's Shell (7.2.4 2/2/92)
To: (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: <>
Date: Thu, 14 Jul 94 18:38:55 CDT
From: Mike Raffety <>
X-Organization: Swiss Bank Corporation
Subject: Re: NIS map ypservers

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


Return-Path: <>
From: (Andrew Law)
Date: 15 Jul 94 02:36:12 GMT
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.



Return-Path: <>
From: Stefan Turowski <>
Date: Fri, 15 Jul 1994 10:28:54 +0200
Subject: Re: NIS map ypservers
Newsgroups: info.sun-managers
References: <302r4p$>

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.

Stefan Turowski
Universitaet Erlangen


Return-Path: <>
From: Markus Storm <>
Date: Fri, 15 Jul 1994 13:24:19 +0200
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"; \

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

Gruß Markus

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


Return-Path: <>
Date: Fri, 15 Jul 94 05:26:01 EST
To: (Theo Wawers / ZD)
Subject: NIS map ypservers
Newsgroups: comp.sys.sun.admin,info.sun-managers
In-Reply-To: <302r4p$>
References: <302r4p$>

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.

Paulo Licio de Geus			INTERNET:
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: <> Date: Fri, 15 Jul 94 08:14:52 EDT From: (Dan Zegarac) To: 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. phone: (810) 825-5451 pager: (810) 610-4738


Return-Path: <> Date: Sun, 17 Jul 94 12:18:43 IDT From: (Edward Resnick - Sys Adm Team (1723)) To: 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


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: 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....




======================================================================== Theo Wawers LAHMEYER INTERNATIONAL GMBH email : 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