Bug 10112 - Usage of "ps" is too expensive
Summary: Usage of "ps" is too expensive
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: initscripts   
(Show other bugs)
Version: 1.0
Hardware: All Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-03-10 15:06 UTC by Enrico Scholz
Modified: 2014-03-17 02:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-03-20 16:32:49 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Enrico Scholz 2000-03-10 15:06:03 UTC
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

    return 1

Perhaps a substitution by "pidof $base" is possible also.

Comment 1 Bill Nottingham 2000-03-20 16:32:59 UTC
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.