Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 601615 - ypbind fails to start with multiple NIS servers
ypbind fails to start with multiple NIS servers
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ypbind (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Karel Klíč
Karel Volný
Depends On:
  Show dependency treegraph
Reported: 2010-06-08 06:25 EDT by Karel Klíč
Modified: 2010-11-10 17:00 EST (History)
5 users (show)

See Also:
Fixed In Version: ypbind-1.20.4-28.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 601296
Last Closed: 2010-11-10 17:00:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Karel Klíč 2010-06-08 06:25:09 EDT
+++ This bug was initially created as a clone of Bug #601296 +++

Created an attachment (id=421877)
change ypbind init script to call domainname only on first domainname listed in yp.conf

We have multiple NIS servers that dhcclient populates for us in /etc/yp.conf.  When ypbind starts, if domainname is not set, it awk's out the 'domain <domainname>' lines from yp.conf then calls "domainname" with the [potentially numerous] domains.  As of Fedora 13, domainname will not run with multiple domains on the command line, thus ypbind fails to start.

Boot messages (replacing real domainname with OurNISDomain):

Setting NIS domain: domain is 'OurNISDomain
OurNISDomain'  Usage: hostname [-v] [-b] {hostname|-F file}         set host name (from file)
       hostname [-v] [-d|-f|-s|-a|-i|-y|-A|-I]             display formatted name
       hostname [-v]                                 display host name

       {yp,nis,}domainname [-v] {nisdomain|-F file}  set NIS domain name (from file)
       {yp,nis,}domainname [-v]                      display NIS domain name

       dnsdomainname [-v]                            display dns domain name

       hostname -V|--version|-h|--help               print info and exit

Program name:
       {yp,nis,}domainname=hostname -y
       dnsdomainname=hostname -d

Program options:
    -s, --short            short host name
    -a, --alias            alias names
    -i, --ip-address       addresses for the host name
    -I, --all-ip-addresses all addresses for the host
    -f, --fqdn, --long     long host name (FQDN)
    -A, --all-fqdns        all long host names (FQDNs)
    -d, --domain           DNS domain name
    -y, --yp, --nis        NIS/YP domain name
    -b, --boot             set default hostname if none available
    -F, --file             read host name or NIS domain name from given file

   This command can get or set the host name or the NIS domain name. You can
   also get the DNS domain or the FQDN (fully qualified domain name).
   Unless you are using bind or NIS for host lookups you can change the
   FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
   part of the FQDN) in the /etc/hosts file.
Starting NIS service: domainname not set - aborting.

Suggested fix: take the first domainname in yp.conf and use only that.  Works for me.

Of course, if domainname is *suppose* to take multiple NIS domainnames, then this bug should be shifted over to net-tools.

--- Additional comment from kklic@redhat.com on 2010-06-08 06:24:08 EDT ---

Thank you.
I agree that the first domainname should be used if none is set.

Fixed in
 - Rawhide:   ypbind-1_31-6_fc14
 - Fedora 13: ypbind-1_31-4_fc13
Comment 2 RHEL Product and Program Management 2010-06-08 06:53:00 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
Comment 4 Karel Volný 2010-10-01 05:06:33 EDT
the new initscript now reads:

NISDOMAIN=`grep "domain" /etc/yp.conf | grep -v ^# | \                                                                                                              
     awk '{print $2}' | head -1`                                                                                                                                     

so only the first line is taken

however, I'd suggest (for the future) to use the simpler command proposed in bug #601296 comment #2 as it uses just one awk call instead of four commands:

NISDOMAIN=`awk '/^[^#]/ { if ($1 == "domain") {print $2; exit} }' /etc/yp.conf`
Comment 5 releng-rhel@redhat.com 2010-11-10 17:00:20 EST
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.