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 1255183 - lastcomm missing '--pid' flag that was present in RHEL6
Summary: lastcomm missing '--pid' flag that was present in RHEL6
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: psacct
Version: 7.2
Hardware: All
OS: All
unspecified
medium
Target Milestone: rc
: ---
Assignee: Jan Rybar
QA Contact: David Jež
Lenka Kimlickova
URL:
Whiteboard:
Depends On:
Blocks: 1298243 1380361 1393867
TreeView+ depends on / blocked
 
Reported: 2015-08-19 21:08 UTC by Frank Hirtz
Modified: 2020-09-10 09:25 UTC (History)
5 users (show)

Fixed In Version: psacct-6.6.1-12.el7
Doc Type: Release Note
Doc Text:
"lastcomm" now supports the "--pid" option The "lastcomm" command now supports the "--pid" option. This option shows the process ID (PID) and parent-process ID (PPID) for each record if supported by the kernel.
Clone Of:
Environment:
Last Closed: 2017-08-01 20:35:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
lastcomm shows PID and PPID if supported (3.04 KB, patch)
2017-02-13 10:57 UTC, Jan Rybar
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1953 0 normal SHIPPED_LIVE psacct bug fix update 2017-08-01 18:29:41 UTC

Description Frank Hirtz 2015-08-19 21:08:08 UTC
Description of problem:

In rhel6, the lastcomm binary (part of the psacct package) included a patch which added a flag, --pid, which would print out the processes pid and ppid. 

It looks like that patch (psacct-6.3.2-ppid.patch) was dropped in rhel7. 

We've found it to be very useful and would like to see it restored in rhel7.

Version-Release number of selected component (if applicable):
psacct-6.6.1-9.el7.x86_64

Steps to Reproduce:
1. lastcomm --pid


Actual results:
<snip>
[root@garabaldi ~]# lastcomm --pid
lastcomm: unrecognized option '--pid'
Usage: lastcomm [-hpV] [-f file] [command] ... [user] ... [terminal] ...
       [--forwards] [--file <file>] [--strict-match] [--print-controls]
       [--user <name>] [--tty <name>] [--command <name>] [--debug]
       [--show-paging] [--ahz <freq>] [--version] [--help]

The system's default process accounting file is /var/account/pacct.
[root@garabaldi ~]# 
</snip>

Expected results:
<snip>
[root@ivanova fmhirtz]# lastcomm --pid | head -5
lastcomm                root     pts/0      0.38 secs Wed Aug 19 17:06     3573     3551
postmaster         F    postgres __         0.00 secs Wed Aug 19 17:06     3571     2487
xauth             S     root     pts/0      0.00 secs Wed Aug 19 17:06     3570     3551
bash               F    root     pts/0      0.00 secs Wed Aug 19 17:06     3568     3551
id                      root     pts/0      0.00 secs Wed Aug 19 17:06     3569     3568
<snip>

Additional info:

Comment 1 Jaromír Cápík 2015-08-20 17:35:50 UTC
Hello Frank.

The --pid switch was introduced by the previous component maintainer. Unfortunately the patch didn't get upstream for some reason. I could try to forward-port this and propagate upstream.

Let's see how that goes.

Thanks,
Jaromir.

Comment 7 Jaromír Cápík 2016-01-14 13:52:56 UTC
Hello Frank.

The project has a bug tracker on savannah.

https://savannah.gnu.org/bugs/?group=acct

You could also try to contact Markus Gothe <nietzsche.se> directly.

Comment 13 Jan Rybar 2017-02-13 10:57:39 UTC
Created attachment 1249792 [details]
lastcomm shows PID and PPID if supported

Comment 22 errata-xmlrpc 2017-08-01 20:35:48 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-2017:1953


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