Bug 10112 - Usage of "ps" is too expensive
Usage of "ps" is too expensive
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: initscripts (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-03-10 10:06 EST by Enrico Scholz
Modified: 2014-03-16 22:12 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-03-20 11:32:49 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 Enrico Scholz 2000-03-10 10:06:03 EST
I am running a NIS server (ypserv) being used as client (ypbind) also. At
shutdown I recognize a lockup (until a timeout occurs) of all services
going to killed after ypserv (e.g. portmap).

Tracing back led to the execution of "ps -h" in
/etc/rc.d/init.d/functions::killproc(). "ps" doesn't take care for any
option and tries to make a lookup for the user/group-name of each running
process. But because the NIS server is shut down already, nobody listens
for it and the lookup will hang.

Best solution would be IMHO the modification of "ps" so it's doing a
minimal work only. For the meantime I suggest a substitution of "ps h" by
"lookForPid" being defined as:

------
lookForPid() {
    while [ "$1" ]; do
       [ -d /proc/$1 ] && return 0
       shift
    done

    return 1
}
------

Perhaps a substitution by "pidof $base" is possible also.
Comment 1 Bill Nottingham 2000-03-20 11:32:59 EST
Should be changed as of 5.02-1.

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