Next | Prev | Up | Top | Contents | Index

Setting Up the Accounting System

If you have installed the system accounting option, all the files and command lines for implementation have been set up properly. You may wish to verify that the entries in the system configuration files are correct. In order to automate the operation of the accounting system, you should check that the following have been done:

  1. The file /etc/init.d/acct should contain the following lines (among others):

    /usr/lib/acct/startup

    /usr/lib/acct/shutacct

    The first line starts process accounting during the system startup process; the second stops it before the system is brought down.

  2. For most installations, the following entries should be in /var/spool/cron/crontabs/adm so that cron automatically runs the daily accounting. These lines should already exist:

    0 4 * * 1-6 if /etc/chkconfig acct; then /usr/lib/acct/runacct 2> /var/adm/acct/nite/fd2log; fi

    5 * * * 1-6 if /etc/chkconfig acct; then /usr/lib/acct/ckpacct; fi

    Note that the above cron commands appear on one line in the source file. The following command, which is also all on one line in the source file, should be in /var/spool/cron/crontabs/root:

    0 2 * * 4 if /etc/chkconfig acct; then /usr/lib/acct/dodisk > /var/adm/acct/nite/disklog; fi

  3. To facilitate monthly merging of accounting data, the following entry in /var/spool/cron/crontabs/adm allows monacct to clean up all daily reports and daily total accounting files, and deposit one monthly total report and one monthly total accounting file in the fiscal directory:

    0 5 1 * * if /etc/chkconfig acct; then /usr/lib/acct/monacct; fi

    The above command is all on one line in the source file, and takes advantage of the default action of monacct that uses the current month's date as the suffix for the file names. Notice that the entry is executed when runacct has sufficient time to complete. This will, on the first day of each month, create monthly accounting files with the entire month's data.

  4. You may wish to verify that an account exists for adm. Also, verify that the PATH shell variable is set in /var/adm/.profile to:

    PATH=/usr/lib/acct:/bin:/usr/bin

  5. To start up system accounting, simply type the commands

    chkconfig acct on

    and

    /usr/lib/acct/startup

The next time the system is booted, accounting starts.


Next | Prev | Up | Top | Contents | Index