6. Process Accounting Setup on Linux

  1. Compile and install process accounting software.

    The process accounting software package is available from http://sunsite.unc.edu/pub/Linux/system/admin/quota-acct-modified.tgz

  2. Modify your system init script and turn on process accounting at boot time.

    Here's an example:

    # Turn process accounting on. 
    if [ -x /sbin/accton ]
    then 
    		/sbin/accton /var/log/pacct 
    		echo "Process accounting turned on." 
    fi
    						
  3. Create accounting record file "pacct."

    Your process accounting software will print out all commands executed to the file /var/log/pacct by default.

    To create the accounting record file:
    touch /var/log/pacct

    This record file should be owned by root, and it has read-write permission for root and read permission for anybody else:

    chown root /var/log/pacct
    chmod 0644 /var/log/pacct
  4. Reboot.

    Now reboot your system for changes you made to take effect.