Bug 637176 - checkpid() function in /etc/init.d/functions won't work with plural pids
Summary: checkpid() function in /etc/init.d/functions won't work with plural pids
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: initscripts
Version: 5.5
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: initscripts Maintenance Team
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 668576
TreeView+ depends on / blocked
 
Reported: 2010-09-24 14:17 UTC by marek.j.bednarczyk
Modified: 2014-09-08 09:45 UTC (History)
4 users (show)

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.
Clone Of:
Environment:
Last Closed: 2011-07-21 08:37:11 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1081 normal SHIPPED_LIVE initscripts bug fix and enhancement update 2011-07-21 08:33:52 UTC

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


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