Bug 143838 - ps -C only uses 1st 8 chars of command name
ps -C only uses 1st 8 chars of command name
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: procps (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
:
Depends On:
Blocks: 132991
  Show dependency treegraph
 
Reported: 2004-12-29 12:49 EST by John S. Hendry
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-19 23:25:50 EDT
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 John S. Hendry 2004-12-29 12:49:00 EST
Description of problem:

The "ps -C" command only matches on the first 8 chars of the command
it is given to check.

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

Red Hat 7.3 and Red Hat Enterprise Linux v3. 

How reproducible: 100% (bash or tcsh)

Steps to Reproduce: (bash example given)

1. Make the following 2 shell scripts:

$ ls -l
total 8
-rwxrwxr-x    1 jhendry  sdss           32 Dec 29 11:21 psTest_1
-rwxrwxr-x    1 jhendry  sdss           32 Dec 29 11:21 psTest_10
$
$ cat psTest_1
#!/usr/local/bin/bash
sleep 100
$
$ cat psTest_10
#!/usr/local/bin/bash
sleep 100
$

2. Run them both in the background simultaneously:

$ for x in $(ls);do ./$x&
> done
[1] 1087
[2] 1088
$

3. Enter an "ps -C" for either of the two scripts OR
   for any name sigificant AFTER the first 8 chars:

Actual results:

$ ps -C psTest_10
  PID TTY          TIME CMD
 1087 pts/0    00:00:00 psTest_1
 1088 pts/0    00:00:00 psTest_10
$

$ ps -C psTest_123456     
  PID TTY          TIME CMD
 1087 pts/0    00:00:00 psTest_1
 1088 pts/0    00:00:00 psTest_10
$ 


Expected results:

$ ps -C psTest_10
  PID TTY          TIME CMD
 1088 pts/0    00:00:00 psTest_10
$ 

$ ps -C psTest_123456     
  PID TTY          TIME CMD
$

Additional info:

Our machines include both Redhat 7.3 and Redhat Enterprise Linux.
The same problem occurs on both platforms.
The same problem occurs whether running bash or tcsh.

On Redhat 7.3
$ ps --version
procps version 2.0.7
$

On Redhat Enterprise Linux
$ ps --version
procps version 2.0.13
$
Comment 1 Karel Zak 2004-12-30 03:19:58 EST
Yes, your're right there is 8bytes limit. The latest version of procps
has 16bytes limit for this. I think it should be works without
limits... I will prepare a patch for this.
Comment 3 Albert Cahalan 2005-01-05 14:19:07 EST
The kernel only provides 15 characters to work with.
Recent procps releases use all of this.
Comment 4 Dennis Gregorovic 2005-05-19 23:25:50 EDT
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 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.

http://rhn.redhat.com/errata/RHBA-2005-156.html

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