Bug 143821

Summary: Silly bug in /etc/init.d/ypserv prevents daemon from starting
Product: Red Hat Enterprise Linux 3 Reporter: Ion Badulescu <ionut>
Component: ypservAssignee: Chris Feist <cfeist>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 3.0CC: cfeist, shillman, steved
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-01-03 18:03:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ion Badulescu 2004-12-29 00:58:56 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Gecko/20041211 Firefox/1.0

Description of problem:
This is the beginning of the start() function in the ypserv startup
script:

        DOMAINNAME=`domainname`
        if [ "$DOMAINNAME" = "(none)" -o "$DOMAINNAME" = "" ]; then
            if [ -n "$NISDOMAIN" ]; then
                action $"Setting NIS domain name $NISDOMAIN: "
domainname $NISDOMAIN
            else
                exit 1
            fi
        fi
        if [ ! -d /var/yp/$DOMAINNAME ]; then
                exit 1
        fi

If the domainname is not initialized, then it is set to the value of
the NISDOMAIN variable. However, the DOMAINNAME shell variable is
never re-initialized, so the test -d /var/yp/$DOMAINNAME fails.

The fix is obvious, I won't insult you guys by listing it here. :-)

As a workaround, it works on a second run (duh). That's probably what
all the SA's using ypserv on RHEL3 are currently doing...



Version-Release number of selected component (if applicable):
ypserv-2.8-11

How reproducible:
Always

Steps to Reproduce:
1. Set up ypserv on a server, enable it in runlevel 3
2. Reboot
3. Observe how it is not running after the server comes up
    

Additional info:

I'm listing it as severity: high, because a server that refuses to
start when it's supposed to is a rather critical problem. Loss of data
*can* occur if all ypservers are down and no authentication mechanism
is available.

Comment 2 Chris Feist 2005-01-03 16:53:17 UTC
I don't see these lines in the ypserv-2.8-11 rpm.

        if [ ! -d /var/yp/$DOMAINNAME ]; then
                exit 1
        fi

Can you run 'rpm -qf /etc/init.d/ypserv' to verify that the ypserv
package owns that file.  (To make sure some other rpm hasn't
overwritten it).

Is it also possible that someone added those lines into the init script?

Can you also give me the output of 'rpm --verify ypserv'?


Comment 3 Ion Badulescu 2005-01-03 18:03:07 UTC
Ugh, I must have been on some serious crack when I looked into this.

You're right, the "! -d /var/yp/$DOMAINNAME" change is a local change
to the script, which was originally made (correctly) to rh9 and then
migrated (incorrectly) to rhel3.

Sorry for wasting your time, I'm closing this report with NOTABUG
(though PEBCAK--Problem Exists Between Chair And Keyboard--would be
more appropriate...