I recently adopted NIS and trying to deal with old bugs. Note that nis package
is going to be completely revamped with systemd use and split of the package,
but this issue (and the merged 118023) seems still of interest.

First of all, *current* ypbind is not able to bind automagically to a local ypserv if the loopback address is not set in /etc/yp.conf. I suspect that
this issue would not be an issue at all if ypbind would connect an
external server via -broadcast or its ip. Note that in order to use broadcast
even in buster+ now it is mandatory using -r option in rpcbind, which is not
the default. Current nis package still shows exactly this behavior at its first installation on a new box. But *now* the postinst does not fail at all,
the ypbind goes in background and timeouts when broadcast fails, but
it runs forever with RPC timeouts.

This is the result of fresh install on buster:

Setting up libtirpc3:amd64 (1.1.4-0.4) ...
Setting up rpcbind (1.2.5-0.3+deb10u1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/rpcbind.service → 
/lib/systemd/system/rpcbind.service.
Created symlink /etc/systemd/system/sockets.target.wants/rpcbind.socket → 
/lib/systemd/system/rpcbind.socket.
Setting up nis (3.17.1-3+b1) ...

Progress: [ 90%] [#####################################################################################################################################..............]
[... some minutes after ... ]

Setting up nis (3.17.1-3+b1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10) ...
Processing triggers for systemd (241-7~deb10u5) ...

So, the postinst now apparently is not failing at all even if syslog reports:

Jan  6 10:22:30 buster nis[1039]: Setting NIS domainname to: localdomain.
Jan  6 10:23:24 buster ypbind[1051]: broadcast: RPC: Timed out.
Jan  6 10:24:18 buster ypbind[1051]: broadcast: RPC: Timed out.
Jan  6 10:25:12 buster ypbind[1051]: broadcast: RPC: Timed out.
Jan  6 10:25:26 buster nis[1039]: Starting NIS services: ypbindbinding to YP 
server...........................................failed (backgrounded).
Jan  6 10:25:26 buster nis[1039]: .
Jan  6 10:25:26 buster systemd[1]: Started LSB: Start NIS client and server 
daemons..
Jan  6 10:25:27 buster systemd[1]: Reloading.
Jan  6 10:26:06 buster ypbind[1051]: broadcast: RPC: Timed out.
Jan  6 10:27:00 buster ypbind[1051]: broadcast: RPC: Timed out.
Jan  6 10:27:54 buster ypbind[1051]: broadcast: RPC: Timed out.

... and the ypbind timeouts forever.

Note that this is expect because the empty /etc/yp.conf triggered the 
-broadcast:

root      1051     1  0 10:22 ?        00:00:00 /usr/sbin/ypbind -broadcast

and there is no server available in my test.

Now, let's add a server by changing /etc/default/nis and restarting the services.

/etc/init.d/nis restart

[... hangs again because of ypbind, then after some minutes: ]

[ ok ] Restarting nis (via systemctl): nis.service.

At this point a /usr/lib/yp/ypinit -m can be issued and it works. Now again a restart of ypbind is due and again it hangs because of the missing ypserver spec in /etc/yp.conf, and a broadcast never answered.

Of course, I could simply add 127.0.0.1 to /etc/yp.conf and restart.
But let's pretend it was able to magically understand that it should talk
with the local server and reboot. Well, nothing chaged, still RPC timeouts.

Now, this report apparently says that stopping and restarting ypbind after the upgrade was be able to work even with an empty /etc/yp.conf before nis 3.9

Unfortunately this is not more the case, at least in the last 17 years
or so, as shown in #118023:

$ sudo ypbind No NIS server and no -broadcast option specified.
Add a NIS server to the /etc/yp.conf configuration file,
or start ypbind with the -broadcast option.

Therefore, on the basis of this trials I will go to close this
bug because it is unfortunately the way ypbind works and so
basically a configuration issue. Also, the postinst does not fail for the issues with ypbind configurations at least from jessie and nis 3.17-33, which expose the same behavior.
I'll leave this bug open at least until next package release.

-cheers

Francesco




On Fri, Aug 14, 2009 at 01:24:07PM +1000, Ben Finney wrote:
package nis
found 213733 3.17-27
tags 213733 - moreinfo
found 118023 3.17-27
tags 118023 - moreinfo
thanks

On 02-Oct-2003, Paul Schulz wrote:
Upgrade NIS in testing distribution and NIS fails to restart.

The usual messages is reported.
  Starting NIS services: ypbind [binding to YP server .......... backgrounded]

NIS can be stopped and restarted several times with the same result.
(It was running previously without a problem.)

I have exactly the same problem on upgrading to version 3.17-27, with
this output:

=====
$ sudo /etc/init.d/nis restart
Stopping NIS services: ypbind ypserv ypppasswdd ypxfrd.
Starting NIS services: ypserv yppasswdd ypxfrd ypbindbinding to YP 
server...........................................failed (backgrounded).
.
=====

If 'ypbind' is started manually,

  # /usr/sbin/ypbind -f /etc/defaultdomain

The follwoing error is reported..

  io:~# /usr/sbin/ypbind -f /etc/defaultdomain
  No NIS server and no -broadcast option specified.
  Add a NIS server to the /etc/defaultdomain configuration file,
  or start ypbind with the -broadcast option.

=====
$ sudo kill $(cat /var/run/ypbind.pid)  # the restart left a process that will 
retry indefinitely

$ ps -ef | grep '[y]p'
root     16875     1  0 12:45 ?        00:00:00 /usr/sbin/ypserv
root     16878     1  0 12:45 ?        00:00:00 /usr/sbin/rpc.yppasswdd -D /etc 
-e chsh -e chfn
root     16881     1  0 12:45 ?        00:00:00 /usr/sbin/rpc.ypxfrd

$ grep -v '^\(#.*\|\)$' /etc/yp.conf    # don't show comment or empty lines

$ sudo /usr/sbin/ypbind -f /etc/yp.conf
No NIS server and no -broadcast option specified.
Add a NIS server to the /etc/yp.conf configuration file,
or start ypbind with the -broadcast option.
=====

BUT
If this option is put in, then ypbind starts properly
and then (surprisingly) NIS works again as expected.

Restarting manually with the ‘-broadcast’ option doesn't help:

=====
$ ps -ef | grep '[y]p'
root     16875     1  0 12:45 ?        00:00:00 /usr/sbin/ypserv
root     16878     1  0 12:45 ?        00:00:00 /usr/sbin/rpc.yppasswdd -D /etc 
-e chsh -e chfn
root     16881     1  0 12:45 ?        00:00:00 /usr/sbin/rpc.ypxfrd

$ sudo /usr/sbin/ypbind -broadcast

$ ps -ef | grep '[y]p'
root     16875     1  0 12:45 ?        00:00:00 /usr/sbin/ypserv
root     16878     1  0 12:45 ?        00:00:00 /usr/sbin/rpc.yppasswdd -D /etc 
-e chsh -e chfn
root     16881     1  0 12:45 ?        00:00:00 /usr/sbin/rpc.ypxfrd
root     17268     1  0 12:55 ?        00:00:00 /usr/sbin/ypbind -broadcast

$ ypcat group
No such map group.byname. Reason: Can't bind to server which serves this domain
=====

Since the automated service restart interface breaks, this also breaks
during postinst, so I'm sending this comment to Bug#118023 also.

--
\     “I must say that I find television very educational. The minute |
 `\       somebody turns it on, I go to the library and read a book.” |
_o__)                                                    —Groucho Marx |
Ben Finney <b...@benfinney.id.au>



--
Francesco P. Lovergine

Reply via email to