Bug 1722

Summary: darn it, let me do the functions script again
Product: [Retired] Red Hat Linux Reporter: president
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2CC: president, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-03-30 22:43:37 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 president 1999-03-24 00:40:25 UTC
I screwed up the last bug report, this is the change that
needs to be made

From
===============
        else
                pid=`ps auxww | grep '[^[]'$1 | awk '{print
$2}'`
                if [ "$pid" != "" ] ; then
                        echo "$1 $2 (pid $pid) is
running..."
                        return 0
                fi
        fi
=============
to
=============
        elseif [ "$2" != "" ]
                pid=`ps auxww | grep '[^[]'$1 | awk '{print
$2}'`
                if [ "$pid" != "" ] ; then
                        echo "$1 $2 (pid $pid) is
running..."
                        return 0
                fi
        fi
=============

Comment 1 Bill Nottingham 1999-03-24 14:11:59 UTC
*** Bug 1721 has been marked as a duplicate of this bug. ***

I really don't know why I should help since you guys seem
to becoming half MicroSoft and have open source in your
mentality, but just because you guys have been good in the
past, am I willing to help you fix a brain dead mistake.
You should check to see if $2 is equal to null first before
using it in /etc/rc.d/init.d/functions

Change
===============================
        else [ "$2" != "" ]
                pid=`ps auxww | grep '[^[]'$1 | awk '{print
$2}'`
                if [ "$pid" != "" ] ; then
                        echo "$1 $2 (pid $pid) is
running..."
                        return 0
                fi
        fi
===========================

to
=========================

        elseif [ "$2" != "" ]
                pid=`ps auxww | grep '[^[]'$1 | awk '{print
$2}'`
                if [ "$pid" != "" ] ; then
                        echo "$1 $2 (pid $pid) is
running..."
                        return 0
                fi
        fi
==========================

Comment 2 Bill Nottingham 1999-03-30 22:43:59 UTC
fixed in initscripts-3.97-2. possibly also fixed at some
point earlier.