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 601296 - ypbind fails to start with multiple NIS servers
ypbind fails to start with multiple NIS servers
Product: Fedora
Classification: Fedora
Component: ypbind (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Karel Klíč
Fedora Extras Quality Assurance
: Reopened
: 636992 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2010-06-07 12:12 EDT by Chris Schanzle
Modified: 2013-03-03 18:01 EST (History)
5 users (show)

See Also:
Fixed In Version: ypbind-1.31-5.fc13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 601615 (view as bug list)
Last Closed: 2010-12-07 15:08:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
change ypbind init script to call domainname only on first domainname listed in yp.conf (468 bytes, patch)
2010-06-07 12:12 EDT, Chris Schanzle
no flags Details | Diff

  None (edit)
Description Chris Schanzle 2010-06-07 12:12:41 EDT
Created attachment 421877 [details]
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.
Comment 1 Karel Klíč 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 Chris Schanzle 2010-08-11 11:51:41 EDT
Karel, thanks for the fix, works fine.

Suggested optimization of reducing these four processes from getting forked off:

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

down to a single awk:

NISDOMAIN=`awk '/^[^#]/ { if ($1 == "domain") {print $2; exit} }' /etc/yp.conf`

Sorry to not offer this up earlier.  I'll close this bug.
Comment 3 Karel Volný 2010-10-01 05:08:32 EDT
reopening, can we use the more effective syntax, pretty please?
Comment 4 Chris Schanzle 2010-10-01 10:37:23 EDT
I strongly agree, and I believe we could remove the comment line check too, since the $1 comparison will never match a comment line anyway:

NISDOMAIN=`awk '{ if ($1 == "domain") {print $2; exit} }' /etc/yp.conf`

Either way, still a nice reduction from 4 fork/exec calls down to 1.  Optimal.
Comment 5 Karel Klíč 2010-11-19 15:46:27 EST
*** Bug 636992 has been marked as a duplicate of this bug. ***
Comment 6 Karel Klíč 2010-11-19 15:50:09 EST

Updated in ypbind-1.32-3.fc15.
Comment 7 Fedora Update System 2010-11-23 05:50:56 EST
ypbind-1.31-5.fc13 has been submitted as an update for Fedora 13.
Comment 8 Fedora Update System 2010-11-23 16:55:10 EST
ypbind-1.31-5.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update ypbind'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/ypbind-1.31-5.fc13
Comment 9 Fedora Update System 2010-12-07 15:08:39 EST
ypbind-1.31-5.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

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