Description of problem: The /etc/init.d/ypbind script fails if there are multiple lines placed in /etc/yp.conf by DHCP, as when there are multiple NIS servers on the network, when DOMAINNAME is not specified in /etc/sysconfig/network. Version-Release number of selected component (if applicable): ypbind-1.31-3.fc13.x86_64 How reproducible: Let's say we have an /etc/yp.conf that looks like this: # generated by /sbin/dhclient-script domain arlut server 10.4.1.6 domain arlut server 10.4.1.23 The /etc/init.d/ypbind script has this excerpt: NISDOMAIN=`grep "domain" /etc/yp.conf | grep -v ^# | \ awk '{print $2}'` the problem with this is that when yp.conf has multiple NIS server lines as above, NISDOMAIN is set to "arlut arlut" which is invalid. The domain name is not set to anything sensible, and ypbind fails on boot. Steps to Reproduce: 1. Set up a system without letting firstboot set up NIS at first (I needed to boot the system once under Fedora to get access to the ethernet MAC address before I could actually connect the system to our network). 2. Neglect to set NISDOMAIN in /etc/sysconfig/network 3. Expect to have the /etc/init.d/ypbind script determine the domain name from /etc/yp.conf as a fall-back Actual results: The /etc/init.d/ypbind script fails to extract a proper domain name, and thus fails to bring up the system with NIS correctly. Expected results: /etc/init.d/ypbind will successfully extract the domain name from the /etc/yp.conf server and bring up the system with NIS correctly Additional info: The line that attempts to determine the NIS domain name can be fixed by changing NISDOMAIN=`grep "domain" /etc/yp.conf | grep -v ^# | \ awk '{print $2}'` to NISDOMAIN=`grep "domain" /etc/yp.conf | grep -v ^# | \ awk '{print $2}' | head -1`
Alternately, perhaps /etc/init.d/ypbind could give up attempting to determine the NIS domain itself entirely? The current version tries to work without DOMAINNAME in /etc/sysconfig/network and fails in the attempt.
Created attachment 449312 [details] Fixed version of /etc/init.d/ypbind
*** This bug has been marked as a duplicate of bug 601296 ***