Bug 484

Summary: ps / dbus / hal uid problem
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Mark Hatle <mark.hatle>
Component: meta-yoctoAssignee: Qing He <qing.he>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: Medium CC: kevin.tian, poky.bs.watcher, poky.watcher, richard.purdie, sgw
Version: 0.9   
Target Milestone: 1.0 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Mark Hatle 2010-10-18 16:36:08 UTC
When I run "ps" on my machine.  (ps from procps), I get the following items:


daemon     181  0.0  0.3   1928   484 ?        Ss   00:00   0:00 /sbin/portmap
root       192  0.0  0.0      0     0 ?        S    00:00   0:00 [flush-8:0]
root       195  0.0  0.6   2608   808 ?        Ss   00:00   0:00 /usr/sbin/atd -
42         202  0.0  0.7   2972   880 ?        Ss   00:00   0:00 /usr/bin/dbus-d
43         206  0.0  2.0  13716  2520 ?        Ssl  00:00   0:00 /usr/sbin/hald
root       207  0.0  0.9   3980  1168 ?        S    00:00   0:00 hald-runner
root       214  0.0  0.8   4048  1112 ?        S    00:00   0:00 /usr/libexec/ha
root       223  0.0  0.9   4056  1124 ?        S    00:00   0:00 hald-addon-stor


For some reason the dbus and hal daemons don't have the proper usernames listed.

From the password file:

root:x:0:0:root:/home/root:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
messagebus:x:42:101:Linux User,,,:/var/run/dbus:/bin/sh
haldaemon:x:43:103:HAL:/var/run/hald:/bin/sh

There are entries for messagebus and haldaemon.....
Comment 1 Qing He 2010-11-03 23:39:57 UTC
It looks like it's because that the names are a bit too long

rename "haldaemon" to "haldaemo" and it can show the right name, which means that strlen(user) cannot exceed 8 at the moment.
Comment 2 Qing He 2010-11-04 00:43:40 UTC
Checking around other distros, found they all share this problem, at least that's within debian, ubuntu and redhat

After reading ps.1, the following format specifier description comes into my eyes:

"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. (alias uname, user)"

So the default euser/user/uname length is 8 and does neither widen the field nor cut the textual username.

You can see the effect by specifying the length directly, e.g.
    ps axouser:10,pid
then messagebus and haldaemon shows up


That said, there seems to be not an easy way to specify field width of user alone. There is an option called `w' but it doesn't affect the field.

Anyway, I'm closing this bug. If this feature is truly required, please report a separate bug as whishlist, I'll check for procps upstream later.


btw, there is a patch at debian for `w', see
      http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=396423