Re: UID issue
Randy McMurchy wrote: Jeremy Huntwork wrote these words on 04/21/05 07:23 CST: I'm just curious what causes this, whether it's a 2.6.x issue or a ps issue. Belgarath which runs a 2.4 kernel and procps 3.1.8 doesn't seem to have this problem. My username is longer than 8 characters and it always shows a chopped version of my username in 'ps aux', not the UID. It's coincidental you say this. I first noticed this issue when I noticed your processes when logged into Anduin, which uses a 2.6 kernel. The kernel version has nothing to do with the display of usernames. It doesn't even know about usernames--only uids and gids. It has to be in the ls/ps code. -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
Re: UID issue
Jeremy Huntwork wrote: Bruce Dubbs wrote: Randy McMurchy wrote: The kernel version has nothing to do with the display of usernames. It doesn't even know about usernames--only uids and gids. It has to be in the ls/ps code. That makes sense. Might shadow have an effect on this as well? No. Shadow does not affect ps. I just did an experiment. I created a user 'averylongname' and ps does indeed change this to a number, but ls -l adjusts the column width to accomodate the long name. Investigating... -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
Re: UID issue
Bruce Dubbs wrote: I just did an experiment. I created a user 'averylongname' and ps does indeed change this to a number, but ls -l adjusts the column width to accomodate the long name. Investigating... Investiation complete. The following comment is in the procps source at line 1018 of ps/output.c: // The Open Group Base Specifications Issue 6 (IEEE Std 1003.1, 2004 Edition) // requires that user and group names print as decimal numbers if there is // not enough room in the column, so tough luck if you don't like it. // // The UNIX and POSIX way to change column width is to rename it: // ps -o pid,user=CumbersomeUserNames -o comm // The easy way is to directly specify the desired width: // ps -o pid,user:19,comm // There are a few ways to handle this: 1. Live with it. :) 2. Create an alias for the ps format you want to use and specify a column width you want to use for UID. 3. Specify a format using the PS_FORMAT environment variable. 4. Hack the source. Adding the following code at line 1037 of ps/output.c works: (outbuf+max_rightward) = 0; return max_rightward; -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
Re: UID issue
Bruce Dubbs wrote: Investiation complete. The following comment is in the procps source at line 1018 of ps/output.c: // The Open Group Base Specifications Issue 6 (IEEE Std 1003.1, 2004 Edition) // requires that user and group names print as decimal numbers if there is // not enough room in the column, so tough luck if you don't like it. // // The UNIX and POSIX way to change column width is to rename it: // ps -o pid,user=CumbersomeUserNames -o comm // The easy way is to directly specify the desired width: // ps -o pid,user:19,comm // There are a few ways to handle this: Very interesting. Thanks for the research Bruce. -- Jeremy Huntwork -- http://linuxfromscratch.org/mailman/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page