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 02-16-2008, 11:58 PM   #1
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,533

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
User-ID not being displayed


Hello,

I have a Fedora 8 system, updated with the latest packages. When I run then "ps -ef" command from a gnome-terminal, the user-name of user logged in is not displayed, but instead the associated user-id. For instance:
Code:
...
root      2944  2873  0 20:05 ?        00:00:00 /usr/sbin/gdm-binary -nodaemon
root      2948     1  0 20:05 ?        00:00:00 /usr/sbin/gdm-binary -nodaemon
root      2951  2944  0 20:05 tty7     00:00:16 /usr/bin/X :0 -br -audit 0 -auth /var/gdm/:0.Xauth -nolisten tcp vt7
root      2961     1  0 20:05 ?        00:00:00 /usr/sbin/wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -u -f
500       3045     1  0 20:06 ?        00:00:00 /usr/bin/gnome-keyring-daemon -d
500       3048  2944  0 20:06 ?        00:00:00 /usr/bin/gnome-session
500       3104  3048  0 20:06 ?        00:00:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /etc/X11/xinit/Xclients
500       3107     1  0 20:06 ?        00:00:00 /usr/bin/dbus-launch --exit-with-session /etc/X11/xinit/Xclients
500       3108     1  0 20:06 ?        00:00:00 /bin/dbus-daemon --fork --print-pid 4 --print-address 8 --session
500       3115     1  0 20:06 ?        00:00:00 /usr/libexec/gconfd-2 6
...
Notice that 500 is displayed in lieu of the user-name.

Now, when I run "id" from the same gnome-terminal, the output is as follows:

Code:
uid=500(MyUserId) gid=500(MyUserId) groups=500(MyUserId) context=unconfined_u:system_r:unconfined_t:s0-s0:c0.c1023
In this case, the user-name associated with user-id 500 is known. Similarly when I run gnome's "System Monitor" tool and examine the processes running on the system, the user-name associated with each process is displayed correctly.

When I run "ps -u MyUserId", all of the processes being run by this user are displayed.

Thus is it possible that 'ps' command has a bug? Or am I merely doing something wrong? I've been using the "ps -f" command for years and have only seen this problem when the user-name is not properly listed in /etc/passwd. From the evidence I am seeing, my system's /etc/passwd file appears to be fine.

Here's the relevant entry in /etc/passwd:
Code:
MyUserId:x:500:500:My Real Name:/home/MyUserId:/bin/bash
 
Old 02-17-2008, 12:07 AM   #2
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
When you are logged in, type id. What does it show? How about whoami?
 
Old 02-17-2008, 12:11 AM   #3
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,533

Original Poster
Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
As I indicated in the OP, when I run "id":

Code:
$ id
uid=500(MyUserId) gid=500(MyUserId) groups=500(MyUserId) context=unconfined_u:system_r:unconfined_t:s0-s0:c0.c1023
When I run "whoami":

Code:
$ whoami
MyUserId
P.S. For security reasons, I am using 'MyUserId' in lieu of posting my real user id here on this forum.
 
Old 02-17-2008, 12:12 AM   #4
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
That's a clue. When I run whoami, it shows my username AND my userID. When I run id, I get my username, not my userID. Are you sure your user doesn't happened to be named '500'? LOL

Dumb question, but did you try rebooting? Try creating a new user, log in as the dummy user, and see if it has the same problem

Last edited by Micro420; 02-17-2008 at 12:14 AM.
 
Old 02-17-2008, 12:32 AM   #5
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,533

Original Poster
Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
I created a new user. When I log in as that user and run "id" and "whoami", this is the output I get:

Code:
$ id
uid=501(NewUser) gid=501(NewUser) groups=501(NewUser) context=unconfined_u:system_r:unconfined_t:s0-s0:c0.c1023

$ whoami
NewUser
When I run the "ps -f" command, the user-name is displayed in lieu of the user-id... which is correct.

Code:
$ ps -f
UID        PID  PPID  C STIME TTY          TIME CMD
NewUser   6797  6796  0 21:22 pts/2    00:00:00 -bash
NewUser   7087  6797  1 21:28 pts/2    00:00:00 ps -f
When I view all processes:

Code:
$ ps -ef | tail
500       6186  6185  0 21:09 pts/1    00:00:00 -bash
500       6752     1  0 21:22 ?        00:00:00 /usr/bin/system-config-users
root      6753  6752  0 21:22 ?        00:00:00 /usr/sbin/userhelper -w system-config-users
root      6762  6753  0 21:22 ?        00:00:00 /bin/sh /usr/share/system-config-users/system-config-users
root      6763  6762  0 21:22 ?        00:00:01 /usr/bin/python2 /usr/share/system-config-users/system-config-users.py
root      6788  2344  0 21:22 ?        00:00:00 sshd: NewUser [priv]
NewUser   6796  6788  0 21:22 ?        00:00:00 sshd: NewUser@pts/2
NewUser   6797  6796  0 21:22 pts/2    00:00:00 -bash
NewUser   7139  6797  1 21:29 pts/2    00:00:00 ps -ef
Note the user-id 500 is still displayed for the other user that is logged in.
 
Old 02-17-2008, 12:38 AM   #6
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
Okay, at least we can say that there's something wrong with your account, not the system or ps. Other than that, I have no idea why your original account can't display your name. Is it that big of a deal, and is it affecting anything else?
 
Old 02-17-2008, 12:39 AM   #7
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,533

Original Poster
Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
I just noticed that the issue I am experiencing with "ps" is not merely relegated to my user-account, but to the haldaemon account as well.

Here's a snapshot when I run "ps -ef":

Code:
$ ps -ef
...
avahi     2675  2674  0 20:05 ?        00:00:00 avahi-daemon: chroot helper
root      2692     1  0 20:05 ?        00:00:00 cupsd
68        2701     1  0 20:05 ?        00:00:03 hald
root      2702  2701  0 20:05 ?        00:00:00 hald-runner
root      2722  2702  0 20:05 ?        00:00:00 hald-addon-input: Listening on /dev/input/event5 /dev/input/event4 /dev/input/event1 /dev/input/event6 /dev/input/event7
root      2757  2702  0 20:05 ?        00:00:00 /usr/libexec/hald-addon-cpufreq
68        2758  2702  0 20:05 ?        00:00:00 hald-addon-acpi: listening on acpid socket /var/run/acpid.socket
root      2780  2702  0 20:05 ?        00:00:00 hald-addon-storage: polling /dev/sr0 (every 2 sec)
...
 
  


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
Getting More Displayed Info Hambone_20003 Linux - General 2 10-26-2005 11:57 AM
2 CPUs displayed as 4 stand Linux - General 1 06-01-2004 04:14 AM
Hostname Not Displayed Skipper Linux - Networking 0 05-14-2003 06:45 AM
Incorrect IP displayed. Manuel-H Linux - Networking 7 04-21-2003 01:58 PM
Not all TTF are getting displayed vasah20 Linux - General 4 01-16-2002 12:48 PM


All times are GMT -5. The time now is 12:18 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration