doesn't work with YP/NIS server defined in /etc/yp.conf

Bug #1075234 reported by rjc
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nis (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Hi,

ypbind seems to ignore /etc/yp.conf and passes "-broadcast" to its options.

/etc/yp.conf:

[begin]
# yp.conf Configuration file for the ypbind process. You can define
# NIS servers manually here if they can't be found by
# broadcasting on the local net (which is the default).
#
# See the manual page of ypbind for the syntax of this file.
#
# IMPORTANT: For the "ypserver", use IP addresses, or make sure that
# the host is in /etc/hosts. This file is only interpreted
# once, and if DNS isn't reachable yet the ypserver cannot
# be resolved and ypbind won't ever bind to the server.

# ypserver ypserver.network.com

ypserver mynisserver
[end]

I do have an entry in /etc/hosts for my NIS server.

I checked the the logs and found that "-broadcast" is being used even though ypserver was defined in /etc/yp.conf.
The only reference to "broadcast" I have found was in /etc/init/ypbind.conf.
After hashing "BROADCAST=-broadcast" in that file it all started working just fine.

# lsb_release -rd
Description: Ubuntu 12.04.1 LTS
Release: 12.04

# apt-cache policy nis
nis:
  Installed: 3.17-32ubuntu4.1
  Candidate: 3.17-32ubuntu4.1

Regards,

rjc

Tags: nis yp ypbind
Revision history for this message
Robie Basak (racb) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

I am unable to reproduce this bug. There is logic in /etc/init/ypbind.conf to clear the BROADCAST variable after it is set if yp.conf defines ypserver, and this seems to be working for me with your /etc/yp.conf. I am using 3.17-32ubuntu4.1.

Please could you provide precise steps to reproduce this problem on a freshly installed 12.04.1 system?

Changed in nis (Ubuntu):
status: New → Incomplete
Revision history for this message
rjc (rjcz) wrote : Re: [Bug 1075234] Re: doesn't work with YP/NIS server defined in /etc/yp.conf

On Wed, Nov 14, 2012 at 09:33:02AM GMT, Robie Basak wrote:
> I am unable to reproduce this bug. There is logic in
> /etc/init/ypbind.conf to clear the BROADCAST variable after it is set if
> yp.conf defines ypserver, and this seems to be working for me with your
> /etc/yp.conf. I am using 3.17-32ubuntu4.1.

Absolutely, I can see the logic behind it. However, that variable does
not get cleared on the systems I have tested it under - as I mentioned
before, logs say that "-broadcast" is used. Therefore my conclusion is
that ypserver entry in (or the whole) /etc/yp.conf is ignored.

> Please could you provide precise steps to reproduce this problem on a
> freshly installed 12.04.1 system?

I'm using a script, which relevant part being:

export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical

HOSTS="/etc/hosts"
YPCONF="/etc/yp.conf"
YPBIND="/etc/init/ypbind.conf"
PASSWDFILE="/etc/passwd"
SHADOWFILE="/etc/shadow"
GROUPFILE="/etc/group"
GSHADOWFILE="/etc/gshadow"

printf "\nxxx.xxx.xxx.xxx\tnisserver\n" >> $HOSTS

printf "\nnis\tnis/domain\tstring\tnis.domain" | debconf-set-selections

aptitude -y install nis

echo "+::::::" >> $PASSWDFILE
echo "+::::::::" >> $SHADOWFILE
echo "+:::" >> $GROUPFILE
echo "+:::" >> $GSHADOWFILE

printf "\nypserver nisserver" >> $YPCONF

Then there's a restart.

I had to add this line after the last one in order to make it work:

sed -i 's:\tBROADCAST=-broadcast:#\tBROADCAST=-broadcast' $YPBIND

I don't think I need to add that IP address, NIS domain and YP server
entries are all correct as it simply worked before on 10.04.
Actually now it doesn't even work there as the problem is the same in
both versions. It affected my build on 10.04 as "nis" package got
changed^Wbroken during the LTS cycle.
Probably I should have filed that bug under 10.04 as what used to work
just fine, got broken by a new version of "nis" package.

Regards,

rjc

Revision history for this message
Robie Basak (racb) wrote :

> printf "\nypserver nisserver" >> $YPCONF

Are you missing a final "\n" here? I just tried editing yp.conf, dropped the final \n, and reproduced your behaviour.

Revision history for this message
rjc (rjcz) wrote :

On Wed, Nov 14, 2012 at 03:57:26PM GMT, Robie Basak wrote:
> > printf "\nypserver nisserver" >> $YPCONF
>
> Are you missing a final "\n" here? I just tried editing yp.conf, dropped
> the final \n, and reproduced your behaviour.

I was aware of it, even thought about it while I was replying to your
email, and am "pretty" sure I had tested it WITH the newline and it
hadn't made any difference.
Anyway, as I said before, it used to work before the 10.04 got the new
version (the one where /etc/init.d/yp* got introduced) as I had used
that script fro a while.
I'll try again at the earliest opportunity.

Thanks,

rjc

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for nis (Ubuntu) because there has been no activity for 60 days.]

Changed in nis (Ubuntu):
status: Incomplete → Expired
Revision history for this message
rjc (rjcz) wrote :

On Mon, Jan 14, 2013 at 04:17:44AM GMT, Launchpad Bug Tracker wrote:
> [Expired for nis (Ubuntu) because there has been no activity for 60
> days.]
>
> ** Changed in: nis (Ubuntu)
> Status: Incomplete => Expired

It seems like it was indeed the newline ("\n") character which was
causing the problem. As I've mentioned before, the very same script
worked on 10.04 so the behaviour clearly has changed.

This bug can now be closed.

Kind regards,

rjc

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.