# NIS again

## thecooptoo

thanks - emerged yp-tools :-)

It now stops here 

/usr/lib/yp/ypinit -m

The current list of NIS servers looks like this:

router

Is this correct?  [y/n: y]  y

We need a few minutes to build the databases...

Building /var/yp/cooper.local/ypservers...

Running /var/yp/Makefile...

gmake[1]: Entering directory `/var/yp/cooper.local'

Updating passwd.byname...

Updating passwd.byuid...

Updating group.byname...

Updating group.bygid...

Updating hosts.byname...

Updating hosts.byaddr...

Updating rpc.byname...

Updating rpc.bynumber...

Updating services.byname...

Updating services.byservicename...

Updating netid.byname...

Updating protocols.bynumber...

Updating protocols.byname...

Updating netgroup...

Updating netgroup.byhost...

Updating netgroup.byuser...

Updating mail.aliases...

gmake[1]: Leaving directory `/var/yp/cooper.local'

router has been set up as a NIS master server.

Now you can run ypinit -s router on all slave server.

router root # ypcat passwd

No such map passwd.byname. Reason: Can't bind to server which serves this domain

router root # ps -A |grep port

 1162 ?        00:00:00 portmap

router root # /etc/init.d/domainname start

 * WARNING:  "domainname" has already been started.

 ie portmapper is running. & domainname is set

why cant it bind?

----------

## patrickbores

Hello,

To get ypcat working on the master server, you probably have to run a ypbind on there, believe it or not. Make sure you've got the appropriate init setup by running:

rc-update add portmap default

rc-update add ypbind default

And make sure to edit /etc/conf.d/ypbind and change $YP_DOMAIN to your NIS domain.

Then run /etc/runlevels/default/ypbind start, or just restart the box. Same goes for each slave machine.

Hope this helps,

Patrick

----------

## thecooptoo

router root # /etc/runlevels/default/ypbind start

 * Starting ypbind...

 * No NIS server found                                                            [ !! ]

router root # ps -A |grep yp

 1477 ?        00:00:00 ypserv

17156 ?        00:00:00 ypbind

17157 ?        00:00:00 ypbind

17158 ?        00:00:00 ypbind

17160 ?        00:00:00 ypbind

router root # ps -A |grep port

 1162 ?        00:00:00 portmap

  544 ?        00:00:00 portmap

  545 ?        00:00:00 portmap

router root # ypcat passwd

YPBINDPROC_DOMAIN: Domain not bound

No such map passwd.byname. Reason: Can't bind to server which serves this domain

router root #

----------

## patrickbores

Okay, now edit /etc/yp.conf and set the domain and ypserver variables.

Patrick

----------

## thecooptoo

Ive tried every variation of server/domainname  can think of

The # lines are the ones ive tried- all with the same result

router root # cat /etc/yp.conf

# /etc/yp.conf - ypbind configuration file

# Valid entries are

#domain NISDOMAIN server HOSTNAME

#       Use server HOSTNAME for the domain NISDOMAIN.

domain cooper.local

#domain cooper.local server router

server router.cooper.local

#ypserver router.cooper.local

#server router

#server 192.168.0.10

#ypserver 192.168.0.10

#domain NISDOMAIN broadcast

#       Use  broadcast  on  the local net for domain NISDOMAIN

#       Use server HOSTNAME for the  local  domain.  The

#       IP-address of server must be listed in /etc/hosts.

router root # /etc/init.d/ypserv restart

 * Stopping NIS Server...                                                                [ ok ]

 * Starting NIS Server...                                                                [ ok ]

router root # ypcat passwd

YPBINDPROC_DOMAIN: Domain not bound

No such map passwd.byname. Reason: Can't bind to server which serves this domain

router root # ps -A |grep yp

17156 ?        00:00:00 ypbind

17157 ?        00:00:00 ypbind

17158 ?        00:00:00 ypbind

17160 ?        00:00:00 ypbind

 8496 ?        00:00:00 ypserv

router root # ps -A |grep portmap

 1162 ?        00:00:00 portmap

router root # cat /etc/hosts |grep router

127.0.0.1       router                  localhost              localhost.localdomain   router.cooper.local

192.168.0.10    router		  router.cooper.local

router root #

----------

## thecooptoo

does this help:

xx.xx.xx.xx is my EXTERNAL IP address  - ie its not finding the LAN

router log # ypserv -d

[ypserv (ypserv) 2.8]

Find securenet: 255.0.0.0 255.0.0.0

Find securenet: 0.0.0.0 0.0.0.0

ypserv.conf: dns: 0

ypserv.conf: files: 30

ypserv.conf: xfr_check_port: 1

ypserv.conf: 0.0.0.0/0.0.0.0:*:shadow.byname:2

ypserv.conf: 0.0.0.0/0.0.0.0:*:passwd.adjunct.byname:2

ypproc_domain_nonack("localdomain") [From:xx.xx.xx.xx:1492]

        -> Ignored (not a valid domain)

ypproc_domain_nonack("localdomain") [From:xx.xx.xx.xx:1493]

        -> Ignored (not a valid domain)

ypproc_domain_nonack("localdomain") [From:xx.xx.xx.xx:1493]

        -> Ignored (not a valid domain)

ypproc_domain_nonack("localdomain") [From: xx.xx.xx.xx:1494]

        -> Ignored (not a valid domain)

ypproc_domain_nonack("localdomain") [From: xx.xx.xx.xx:1494]

        -> Ignored (not a valid domain)

ypproc_domain_nonack("localdomain") [From: xx.xx.xx.xx:1495]

        -> Ignored (not a valid domain)

----------

## patrickbores

ypserv is telling you you don't have a valid domain. There should be a configuration file for ypserv in which the domain is defined. What's in there?

----------

## thecooptoo

taken out the commecnted lines

router etc # cat ypserv.conf

dns: no

files: 30

xfr_check_port: yes

# Host                     : Domain  : Map              : Security

#

# *                        : *       : passwd.byname    : port

# *                        : *       : passwd.byuid     : port

192.168.0.10/255.255.0.0   : *       :passwd.byname     :port

192.168.0.10/255.255.0.0   : *       :passwd.byuid      :port

# Not everybody should see the shadow passwords, not secure, since

# under MSDOG everbody is root and can access ports < 1024 !!!

*                          : *       : shadow.byname    : port

*                          : *       : passwd.adjunct.byname : port

#

# *                        : *       : *                : none

router etc # ypcat passwd

No such map passwd.byname. Reason: Can't bind to server which serves this domain

router etc #

----------

## volumen1

Did you ever figure this out?  I have ypserv running and I get the same

```
ypproc_domain_nonack("mydomain") [From: xx.xx.xx.xx:1495]

-> Ignored (not a valid domain)

```

Error.  However, I have the domain name defined in /etc/conf.d/domainname and when I run `nisdomainname` on the box, the domain names match up.

Running ypserv_test on the localhost also gives the same errors.  From the client it says this

```

ypproc_domain_2: ypserv sends NAK instead of ACK

ypproc_domain_nonack_2: RPC: Timed out

ypproc_match_2: ypserv sends -2 instead of YP_TRUE

ypproc_match_2: ypserv sends -2 instead of YP_NOKEY

ypproc_match_2: ypserv sends -2 instead of YP_NOMAP

ypproc_match_2: ypserv sends -2 instead of YP_BADARGS

ypproc_first_2: ypserv sends -2 instead of YP_TRUE

ypproc_first_2: ypserv sends -2 instead of YP_NOMAP

ypproc_first_2: ypserv sends -2 instead of YP_BADARGS

ypproc_next_2: ypserv sends -2 instead of YP_TRUE

ypproc_next_2: ypserv sends -2 instead of YP_NOMORE

ypproc_next_2: ypserv sends -2 instead of YP_NOMORE

ypproc_next_2: ypserv sends -2 instead of YP_NOMAP

ypproc_next_2: ypserv sends -2 instead of YP_BADARGS

```

In the terminal that is running ypserv -d, I see lots of error messages, all saying something the same thing.  (not a valid domain)

----------

## CrazyTerabyte

See also: https://forums.gentoo.org/viewtopic-t-465370.html

----------

