8

Context: on an ubuntu Linux 2.6.24-22-xen #1 SMP x86_64 GNU/Linux

I am starting a daemon via an init.d script but in the "ps" output, it is displaying the daemon's user in numeric form. e.g.

1000  17560  1  1 11:04 ?  00:00:09 /usr/lib/jvm/java-6-sun/bin/java -server 
        -jar /home/superduperadmin/server/daemon.jar

1000 is the mapped to superduperadmin in /etc/passwd.

Why is this ? Is it because superduperadmin is too long ?

2
  • ok, beside that, what is it that you are encountering problems with?
    – Anonymous
    Jul 22, 2009 at 3:24
  • It is not exactly a problem yet. I'm just wondering why some processes's userids are resolved to their textual counterparts while my daemon is not.
    – Jacques René Mesrine
    Jul 22, 2009 at 3:41

3 Answers 3

17

Yes, it's because it's too long...

from the ps(1) man page...

euser  EUSER  effective user name. This will be the textual user ID, 
              if it can be obtained and the field width permits, or 
              a decimal representation otherwise. The n option can be 
              used to force the decimal representation. 
2
  • IIRC the limit for ps is 8 characters and it can't be changed, no matter how wide your terminal is. \o/ Jul 22, 2009 at 7:30
  • I'd been wondering this myself, if perhaps it had something to do with LDAP users, but no. Thanks.
    – TRS-80
    Jul 22, 2009 at 8:10
4

The username is too long to display - more than 8 characters.

If you want a ps listing with longer names, you have to set the allowed maximum length yourself:

$ ps -e -o "pid,user:16,command"
0
  1. rename user 'superduperadmin' to 'sda'.

    renaming the home dir to match is optional, but you do need to edit any scripts, config files, etc that reference that username (or the dir if you DO rename the home dir).

  2. give yourself a whack on the back of the head for creating a user account that requires Too Much Typing to remind yourself not to do it again :)

You must log in to answer this question.