Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 83401 - checkpid function doesn't work for multiple pids
checkpid function doesn't work for multiple pids
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2003-02-03 17:44 EST by Tony Finch
Modified: 2014-03-16 22:34 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-02-03 22:08:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2003:341 normal SHIPPED_LIVE New initscripts packages available 2003-12-19 00:00:00 EST

  None (edit)
Description Tony Finch 2003-02-03 17:44:15 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.0.1) Gecko/20020912

Description of problem:
The comment before checkpid in /etc/rc.d/init.d/functions says
that it is supposed to work for multiple pids, but it returns
as soon as it finds any pid that is running. This isn't a problem
in practice because it is never invoked with more than one pid.

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

How reproducible:

Steps to Reproduce:
$ bash
$ cd /etc/rc.d/init.d
$ . functions
$ checkpid 1 10000
$ echo $?
$ checkpid 10000
$ echo $?
$ ^D

Expected Results:  checkpid should return 0 if all of the pids are running
and 1 otherwise

Additional info:

The code should be

# Check if $pid (could be plural) are running
checkpid() {
        local i

        for i in $* ; do
                [ -d "/proc/$i" ] || return 1
        return 0
Comment 1 Bill Nottingham 2003-02-03 22:08:02 EST
Fixed in cvs, will be in 7.07-1. Thanks!
Comment 2 John Flanagan 2003-12-19 14:13:49 EST
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.


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