Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 637176

Summary: checkpid() function in /etc/init.d/functions won't work with plural pids
Product: Red Hat Enterprise Linux 5 Reporter: marek.j.bednarczyk
Component: initscriptsAssignee: initscripts Maintenance Team <initscripts-maint-list>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: low Docs Contact:
Priority: low    
Version: 5.5CC: azelinka, harald, jscotka, notting
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
When multiple PIDs (Process Identifiers) are passed to the checkpid() function, it exits with the return value of 0 after finding the first existing PID. This is intended behavior of the function but the accompanying comment in the code indicated that the function fully supported multiple PIDs as arguments, which was confusing for some users. With this update, the comment in the code has been clarified.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 08:37:11 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:
Bug Depends On:    
Bug Blocks: 668576    

Description marek.j.bednarczyk 2010-09-24 14:17:28 UTC
Description of problem:

The function checkpid() defined in /etc/init.d/functions is designed to work with plural pids. However even if the plural number od pids are given to the function it will stop and return true after finding the first existing pid.

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


How reproducible:
# . /etc/init.d/functions
# checkpid() [non existing pid] [existing pid] [non existing pid]
# echo $?
0

Steps to Reproduce:
1.
2.
3.
  
Actual results:
Function checkpid() returns always 0 if at least one pid exists

Expected results:
The checkpid() function should rather check existence of only one pid.

Additional info:
This bug is just to solve the confusion that can arise, because checkpid function is not clear to use and understand its behavior.

Comment 1 Bill Nottingham 2010-09-24 16:42:17 UTC
I've clarified this comment; it may be a while before it makes it into a RHEL update.

Comment 6 Tomas Capek 2011-07-13 12:31:12 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When multiple PIDs (Process Identifiers) were passed to the checkpid() function, it exited with the return value of 0 after finding the first existing PID. This bug has been fixed in the /etc/init.d/functions script and the checkpid() function now checks the existence of only one PID.

Comment 7 Tomas Capek 2011-07-14 15:45:31 UTC
I have reworked the tech note according to the plautrba's comments.

Comment 8 Tomas Capek 2011-07-14 15:45:31 UTC
Deleted Technical Notes Contents.

Old Contents:
When multiple PIDs (Process Identifiers) were passed to the checkpid() function, it exited with the return value of 0 after finding the first existing PID. This bug has been fixed in the /etc/init.d/functions script and the checkpid() function now checks the existence of only one PID.

Comment 9 Tomas Capek 2011-07-14 15:45:54 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When multiple PIDs (Process Identifiers) are passed to the checkpid() function, it exits with the return value of 0 after finding the first existing PID. This is intended behavior of the function but the accompanying comment in the code indicated that the function fully supported multiple PIDs as arguments, which was confusing for some users. With this update, the comment in the code has been clarified.

Comment 10 errata-xmlrpc 2011-07-21 08:37:11 UTC
An advisory 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 therefore 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.

http://rhn.redhat.com/errata/RHBA-2011-1081.html

Comment 11 errata-xmlrpc 2011-07-21 12:40:03 UTC
An advisory 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 therefore 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.

http://rhn.redhat.com/errata/RHBA-2011-1081.html