Bug 166431 - ps returning UID & GID sometimes instead of username & group
Summary: ps returning UID & GID sometimes instead of username & group
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: procps
Version: 3
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-08-21 07:46 UTC by Mark D. Smith
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2005-09-07 07:03:15 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mark D. Smith 2005-08-21 07:46:17 UTC
Description of problem:
example of ps -eo user,group,pid,args
returns UID & or GID in place of real username & group

rmhhco   domain60  4874 /usr/bin/perl -T -w /usr/bin/spamassassin

so it is returning the username group pid and args as expected!

after a few repeated ps -eo user,group,pid,args

788      11141     5364 /usr/bin/perl -T -w /usr/bin/spamassassin

788 is eng-vill_leigh domain213

so ps is not always returning the username etc!


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

How reproducible:
very

Steps to Reproduce:
1.just enter ps -eo user,group,pid,args from bash shell.
2.
3.
  
Actual results:
788      11141     5364 /usr/bin/perl -T -w /usr/bin/spamassassin
expected
eng-vill_leigh domain213     5364 /usr/bin/perl -T -w /usr/bin/spamassassin

Expected results:
ps -eo user,group,pid,args
rmhhco   domain60  4874 /usr/bin/perl -T -w /usr/bin/spamassassin

so it is returning the username group pid and args as expected this time!

Additional info:
647      11100     1705 procmail -f glyceride -t -Y -a  -d adstead_00
647      11100     1706 procmail -f glyceride -t -Y -a  -d adstead_00
647      11100     1707 /usr/bin/perl -T -w /usr/bin/spamassassin
root     root      1708 ps -eo user,group,pid,args

as you see UID & GID not username & group.

Comment 1 Karel Zak 2005-09-07 07:03:15 UTC
procps FAQ:

Why do long usernames get printed as numbers?

The UNIX and POSIX standards require that user names and group names be printed
as decimal integers when there is not enough room in the column. Truncating the
names, besides being a violation of the standard, would lead to confusion
between names like MichelleRichards and MichelleRichardson. The UNIX and POSIX
way to change column width is to rename the column:

     ps -o pid,user=CumbersomeUserNames -o comm

The easy way is to directly specify the desired width:

     ps -o pid,user:19,comm
               ^^^^^^^

You have to use: ps -eo user:20,group,pid,args



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