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 ?

migrated from stackoverflow.com Jul 22 '09 at 4:52

This question came from our site for professional and enthusiast programmers.

  • ok, beside that, what is it that you are encountering problems with? – Anonymous Jul 22 '09 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 '09 at 3:41

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. 
  • IIRC the limit for ps is 8 characters and it can't be changed, no matter how wide your terminal is. \o/ – David Pashley Jul 22 '09 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 '09 at 8:10

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"
  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 :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy