RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1518986 - Please add AUID to list of selectable fields in ps.
Summary: Please add AUID to list of selectable fields in ps.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: procps-ng
Version: 7.6
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jan Rybar
QA Contact: Branislav Náter
Marie Hornickova
URL:
Whiteboard:
Depends On:
Blocks: 1477664 1546815 1549617 1549689 1551061
TreeView+ depends on / blocked
 
Reported: 2017-11-29 22:22 UTC by Thomas Gardner
Modified: 2020-12-14 10:55 UTC (History)
6 users (show)

Fixed In Version: procps-ng-3.3.10-21.el7
Doc Type: Enhancement
Doc Text:
The *ps* utility now displays the Login ID associated with processes The new format option "luid" of the *ps* utility now enables you to display the Login ID associated with processes. To display the login ID attributes of running processes, use the following command: $ ps -o luid
Clone Of:
Environment:
Last Closed: 2018-10-30 07:56:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed patch (2.29 KB, patch)
2018-02-09 17:39 UTC, Jan Rybar
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3045 0 None None None 2018-10-30 07:57:01 UTC

Description Thomas Gardner 2017-11-29 22:22:40 UTC
Description of problem:

Every other type of UID that I can think of for a process to have (EUID, RUID, FUID, SUID) can be selected as a field to be displayed in ps output, but not AUID (AKA loginID).  We have a customer that needs to see this in ps output for some scripts he's writing because by the time his script gets the ps output, finds the process it's after, the short-lived process exits.  He can't just have his script go look it up for itself in /proc/###/loginid because that directory disappears when the process exits, before his script has a chance to go get it.

It seems reasonable to ask that it be a valid field in the ps output as every other kind of UID (as far as I can recall) is available.

I doubt we'll have this in time to help this exact situation, but it makes sense to include it anyway for the next guy with the same problem.

Comment 1 Jan Rybar 2017-11-30 13:48:12 UTC
Hello,

it seems to be present in upstream as LUID (loginID) ($ ps -o LUID).
If that is what you meant, I shall backport it in rhel-7.6.

Thanks.

Comment 2 Thomas Gardner 2017-12-04 16:45:02 UTC
Yup.  loginID and AUID are synonymous.  If we wanna call it LUID, too, welp, I guess we can add another synonym.  :-)

Comment 3 Thomas Gardner 2017-12-04 16:47:01 UTC
Oh, yeah, and I'm guessing that the man page will also be updated as part this request reflecting the change in function, right?

Comment 4 Jan Rybar 2017-12-05 10:32:25 UTC
Of course :)
Unless you want to make it an easter egg :D

Comment 5 Jan Rybar 2018-01-19 13:08:55 UTC
I've just peeked at the history of the LUID feature in upstream and it seems to be present there since 2003. And yes, it's in RHEL7 and Fedora also! It just appears to be missing from manpage.

Try the following:
$ ps -eo pid,luid,cmd


Is it the result expected by the customer?

Thanks.

PS: manpage fix is on the way.

Comment 6 Brett Lowry 2018-02-05 18:47:21 UTC
Displaying the the auid is not just a man page fix for the ps command.

iaasn00052525# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.8 (Santiago)
iaasn00052525# id -a
uid=0(root) gid=0(root) groups=0(root)
iaasn00052525# date
Mon Feb  5 13:31:55 EST 2018
iaasn00052525# ps -eo pid,luid,cmd | head
   PID  LUID CMD
     1     - /sbin/init
     2     - [kthreadd]
     3     - [migration/0]
     4     - [ksoftirqd/0]
     5     - [stopper/0]
     6     - [watchdog/0]
     7     - [migration/1]
     8     - [stopper/1]
     9     - [ksoftirqd/1]
iaasn00052525#

The LUID is blank in the ps output. This needs to be fixed. Having it work with -o auid would make sense too, as a suggestion.

Please move forward with a real fix/update.

- Brett Lowry J.P. Morgan Chase.

Comment 7 Brett Lowry 2018-02-05 18:51:46 UTC
Here is a RHEL 7.3 as well:
ashamvarchlab02# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)
ashamvarchlab02# id -a
uid=0(root) gid=0(root) groups=0(root) context=system_u:system_r:unconfined_service_t:s0
ashamvarchlab02# date
Mon Feb  5 13:51:17 EST 2018
ashamvarchlab02# ps -eo pid,luid,cmd | head
  PID  LUID CMD
    1     - /usr/lib/systemd/systemd --switched-root --system --deserialize 20
    2     - [kthreadd]
    3     - [ksoftirqd/0]
    5     - [kworker/0:0H]
    7     - [migration/0]
    8     - [rcu_bh]
    9     - [rcu_sched]
   10     - [watchdog/0]
   11     - [watchdog/1]
ashamvarchlab02#


- Brett Lowry J.P. Morgan Chase.

Comment 8 Jan Rybar 2018-02-09 17:38:02 UTC
Yes, the code in upstream seems like a preparation for the functionality, but without an actual implementation.

The patch implementing the functionality has been sent to upstream.
It will be merged into the nearest RHEL minor release as quickly as it gets merged into upstream.

Comments welcomed.

Comment 9 Jan Rybar 2018-02-09 17:39:09 UTC
Created attachment 1393936 [details]
proposed patch

Comment 10 Jan Rybar 2018-02-23 11:36:33 UTC
Fix accepted by upstream.
This BZ proposed to rhel-7.6.

Comment 18 errata-xmlrpc 2018-10-30 07:56:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3045


Note You need to log in before you can comment on or make changes to this bug.