How can I enable pid and ppid fields in psacct dump-acct?

Solution 1:

I just found this in the changelog for the psacct RPM:

* Fri Nov 13 2009 Ivana Varekova <varekova(at)redhat.com> - 6.3.2-56
  - fix the psacct to deal with all acct types and
    if it is possible and wanted then add the possibility
    to display the pid and ppid number

So it looks like it depends in exactly which release you are using.

Solution 2:

CentOS release 5.6
psacct 6.3.2

The psacct package shipped with CentOS 5.6 has release number 44:

Name       : psacct
Arch       : x86_64
Version    : 6.3.2
Release    : 44.el5
Size       : 107 k
Repo       : installed
Summary    : Utilities for monitoring process activities.
License    : GPL
Description: The psacct package contains several utilities for monitoring process
           : activities, including ac, lastcomm, accton and sa. The ac command
           : displays statistics about how long users have been logged on. The
           : lastcomm command displays information about previous executed
           : commands. The accton command turns process accounting on or off. The
           : sa command summarizes information about previously executed
           : commands.

and as @Ladadadada mentioned, according to the change log, PID and PPID are only available from 6.3.2-56 version. On my CentOS 6 (psacct-6.3.2-63):

accton           |   0.0|   0.0|   1.0|    0|    0|3832.0|   16114    16111|Thu Nov 24 13:37:50 2011
touch            |   0.0|   0.0|   3.0|    0|    0|105088.0|   16115    16111|Thu Nov 24 13:37:50 2011
psacct           |   0.0|   0.0|   9.0|    0|    0|106304.0|   16111    16059|Thu Nov 24 13:37:50 2011
w                |   0.0|   0.0|   3.0|    0|    0|105280.0|   16116    16059|Thu Nov 24 13:37:52 2011