LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-28-2008, 07:34 PM   #1
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Rep: Reputation: 164Reputation: 164
'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?

Last edited by SlowCoder; 05-28-2008 at 07:37 PM.
 
Old 05-29-2008, 05:44 AM   #2
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
can you confirm that running
ps u

has no USER field please
 
Old 05-29-2008, 05:45 AM   #3
clvic
Member
 
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 45
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)
 
Old 05-29-2008, 05:52 AM   #4
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
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.
 
Old 05-29-2008, 07:23 AM   #5
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Original Poster
Rep: Reputation: 164Reputation: 164
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?
 
Old 05-29-2008, 07:43 AM   #6
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
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'
 
Old 05-29-2008, 08:22 AM   #7
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Original Poster
Rep: Reputation: 164Reputation: 164
No, no aliases for ps.

Would it have anything to do with the length of the username?
 
Old 05-29-2008, 08:37 AM   #8
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
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

Last edited by aus9; 05-29-2008 at 08:43 AM.
 
Old 05-29-2008, 10:09 AM   #9
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Original Poster
Rep: Reputation: 164Reputation: 164
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.
 
Old 05-30-2008, 07:33 AM   #10
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
What about the PS_FORMAT environment variable I asked about?
Code:
set | grep '^PS_'
 
Old 05-30-2008, 07:59 AM   #11
Ajax4Hire
LQ Newbie
 
Registered: May 2004
Location: sol 3 (3rd planet from sun)
Distribution: Redhat 9.0
Posts: 8

Rep: Reputation: 0
Quote:
Originally Posted by SlowCoder View Post
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.
 
Old 05-30-2008, 08:28 AM   #12
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Original Poster
Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by archtoad6 View Post
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.
 
Old 05-30-2008, 08:32 AM   #13
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Original Poster
Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by Ajax4Hire View Post
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.
 
Old 05-31-2008, 04:35 AM   #14
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by Ajax4Hire View Post
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.
 
Old 05-31-2008, 10:40 AM   #15
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
one username in ps -aux not resolving FliesLikeABrick Linux - Software 1 01-17-2007 05:20 PM
two users with uids of 0 shanenin Linux - Security 2 03-04-2005 09:57 AM
other users' websites (~username) stlshawn Linux - Networking 4 12-26-2004 08:42 AM
samba - map winbind users to nis uids and gids bkurnik Linux - Networking 0 09-20-2004 06:47 AM
USERS command displays all accunst as root? Why? zick Linux - General 5 09-22-2003 11:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration