LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   'ps aux' displays users as uids, instead of username (https://www.linuxquestions.org/questions/linux-newbie-8/ps-aux-displays-users-as-uids-instead-of-username-645456/)

SlowCoder 05-28-2008 07:34 PM

'ps aux' displays users as uids, instead of username
 
Dunno, but for some reason, after I updated Fedora 7, ps began showing uids instead of the username. I assume this means there is some disassociation between the username and uid in some file, but it is correct in /etc/passwd. It does show 'root' processes. So, where do I go next?

aus9 05-29-2008 05:44 AM

can you confirm that running
ps u

has no USER field please

clvic 05-29-2008 05:45 AM

What about the output of other commands like:
ps -o uid -o "%u %U" -A
or whoami or id ?
Maybe you aliased ps? Or have more than one version installed ("which -a ps" to verify)

aus9 05-29-2008 05:52 AM

if you have time you can check that your /bin/ps should have executable user function eg

Code:

su
strings /bin/ps | grep users

returns for me

strings /bin/ps | grep users
Please send bug reports to <feedback@lists.sf.net> or <albert@users.sf.net>
a all w/ tty, including other users -t by tty
r only running processes U processes for specified users
List of real users must follow --User.
List of effective users must follow --user.
List of users must follow -u.
List of users must follow U.

SlowCoder 05-29-2008 07:23 AM

Here is the output from the commands you all suggested:
Code:

$ ps u
USER      PID %CPU %MEM    VSZ  RSS TTY      STAT START  TIME COMMAND
500      23897  0.0  0.0  4820  1544 pts/1    Ss  08:09  0:00 -bash
500      23963  0.0  0.0  4512  940 pts/1    R+  08:17  0:00 ps u

$ which -a ps
/bin/ps

$ whoami ; id
myusername
uid=500(myusername) gid=500(myusername) groups=500(myusername)

$ ps -o uid -o "%u %U" -A | tail
    0 root    root
    0 root    root
    0 root    root
  500 500      myusername
  500 500      myusername
    0 root    root
  500 500      myusername
  500 500      myusername
  500 500      myusername
  500 500      myusername

The last command does indicate that ps knows my username. So why does the standard 'ps aux' show my uid in the user field?

archtoad6 05-29-2008 07:43 AM

Did you check your aliases?
Is there any chance there is a PS_FORMAT environment variable messing you up?
Try running
Code:

alias | grep 'ps'
# &
set  | grep '^PS'


SlowCoder 05-29-2008 08:22 AM

No, no aliases for ps.

Would it have anything to do with the length of the username?

aus9 05-29-2008 08:37 AM

when you upgraded, did you keep any old files from /etc?

2) did you change your login name....since you mention long username?

edit added (3)
do you have an entry for proc in /etc/fstab eg
none /proc proc defaults 0 0

SlowCoder 05-29-2008 10:09 AM

1. I did not upgrade. I updated. Still Fedora 7. Didn't figure I'd need to back up etc files.
2. No login name change. But the user name is 10 characters long.
3. Yes. The proc entry is in fstab.

archtoad6 05-30-2008 07:33 AM

What about the PS_FORMAT environment variable I asked about?
Code:

set | grep '^PS_'

Ajax4Hire 05-30-2008 07:59 AM

Quote:

Originally Posted by SlowCoder (Post 3168116)
No, no aliases for ps.

Would it have anything to do with the length of the username?

Yes.

If a username is longer than 8 characters, then "ps aux" will substitute the uid for username.
Your username of "myusername" is clearly longer than 8-characters.
I ran into this a while back with the username of "Ajax4Hire", more than 8 and the only user to get truncated to a uid. Realized the problem and renamed myself to Ajax. boo-hoo.

SlowCoder 05-30-2008 08:28 AM

Quote:

Originally Posted by archtoad6 (Post 3169244)
What about the PS_FORMAT environment variable I asked about?
Code:

set | grep '^PS_'

Other than the PS1/2/3/4 variables, no environment variable exists that includes PS or FORMAT.

SlowCoder 05-30-2008 08:32 AM

Quote:

Originally Posted by Ajax4Hire (Post 3169272)
Yes.

If a username is longer than 8 characters, then "ps aux" will substitute the uid for username.
Your username of "myusername" is clearly longer than 8-characters.
I ran into this a while back with the username of "Ajax4Hire", more than 8 and the only user to get truncated to a uid. Realized the problem and renamed myself to Ajax. boo-hoo.

If this actually is the case, I'll have to assume that I simply didn't notice it until after I performed the update.

P.S. "myusername" is not the real name, but the real one is more than 8 characters.

archtoad6 05-31-2008 04:35 AM

Quote:

Originally Posted by Ajax4Hire (Post 3169272)
If a username is longer than 8 characters, then "ps aux" will substitute the uid for username.

HTH did you figure that out?
Is it documented? -- I couldn't find it in the man page, at least the one on my system.

aus9 05-31-2008 10:40 AM

well I have something in /usr/share/doc/procps....has a todo file in mdv 2008.1 version 3.2.7 and it mentions

under -----top----
don't truncate long usernames

in the news file same pathway I have
procps-3.2.2 --> procps-3.2.3

avoid truncating long usernames

-----------------------------------

of course that might explain a shortening of name and not change to uid....but its start.


All times are GMT -5. The time now is 09:31 AM.