Next | Prev | Up | Top | Contents | Index

Fixing Corrupted Files

Sometimes, errors occur in the accounting system, and a file is corrupted or lost. You can ignore some of these errors, or simply restore lost or corrupted files from a backup. However, certain files must be fixed in order to maintain the integrity of the accounting system.


Fixing wtmp Errors

The wtmp files are the most delicate part of the accounting system. When the date is changed and the IRIX system is in multiuser mode, a set of date change records is written into /etc/wtmp. The wtmpfix program is designed to adjust the time stamps in the wtmp records when a date change is encountered. However, some combinations of date changes and reboots will slip through wtmpfix and cause acctcon1 to fail.

The following steps show how to fix a wtmp file:

  1. cd /var/adm/acct/nite

  2. fwtmp < wtmp.MMDD > xwtmp

  3. ed xwtmp

  4. Delete any corrupted records or delete all records from beginning up to the date change.

  5. fwtmp -ic <wtmp> wtmp.MMDD
If the wtmp file is beyond repair, remove the file and create an empty wtmp file:

  1. rm /etc/wtmp

  2. touch /etc/wtmp
This prevents any charging of connect time. acctprc1 cannot determine which login owned a particular process, but it is charged to the login that is first in the password file for that user ID.


Fixing tacct Errors

If the installation is using the accounting system to charge users for system resources, the integrity of sum/tacct is quite important. Occasionally, mysterious tacct records appear with negative numbers, duplicate user IDs, or a user ID of 65,535. First check sum/tacctprev with prtacct. If it looks all right, the latest sum/tacct.MMDD should be patched up, then sum/tacct recreated. A simple patchup procedure would be:

  1. Enter the command:

    cd /var/adm/acct/sum

  2. Enter the command:

    acctmerg -v < tacct.MMDD > xtacct

  3. Enter the command:

    ed xtacct

  4. Remove the bad records.

  5. Write duplicate UID records to another file.

  6. Enter the command:

    acctmerg -i < xtacc t > tacct.MMDD

  7. Enter the command:

    acctmerg tacctprev <tacct.MMDD> tacct

Remember that the monacct procedure removes all the tacct.MMDD files; therefore, you can recreate sum/tacct by merging these files.


Next | Prev | Up | Top | Contents | Index