Bug 166431 - ps returning UID & GID sometimes instead of username & group
Summary: ps returning UID & GID sometimes instead of username & group
Alias: None
Product: Fedora
Classification: Fedora
Component: procps   
(Show other bugs)
Version: 3
Hardware: i686 Linux
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Brian Brock
Depends On:
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:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-07 07:03:15 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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:

Steps to Reproduce:
1.just enter ps -eo user,group,pid,args from bash shell.
Actual results:
788      11141     5364 /usr/bin/perl -T -w /usr/bin/spamassassin
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@talk21.com -t -Y -a  -d adstead_00
647      11100     1706 procmail -f glyceride@talk21.com -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.