Bug 143821 - Silly bug in /etc/init.d/ypserv prevents daemon from starting
Silly bug in /etc/init.d/ypserv prevents daemon from starting
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: ypserv (Show other bugs)
3.0
All Linux
medium Severity high
: ---
: ---
Assigned To: Chris Feist
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-12-28 19:58 EST by Ion Badulescu
Modified: 2007-11-30 17:07 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-01-03 13:03:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ion Badulescu 2004-12-28 19:58:56 EST
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 11:53:17 EST
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 13:03:07 EST
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...

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