[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

System Management Guide: Operating System and Devices


Fixing wtmp Errors

The /var/adm/wtmp, or "who temp" file, might cause problems in the day-to-day operation of the accounting system. When the date is changed and the system is in multiuser mode, date change records are written to the /var/adm/wtmp file. When a date change is encountered, the wtmpfix command adjusts the time stamps in the wtmp records. Some combinations of date changes and system restarts may slip past the wtmpfix command and cause the acctcon1 command to fail and the runacct command to send mail to the root and adm accounts listing incorrect dates.

Prerequisites

You must have root user or adm group authority.

Procedure

  1. Move to the /var/adm/acct/nite directory by typing:

    cd /var/adm/acct/nite
    
  2. Convert the binary wtmp file to an ASCII file that you can edit by typing:

    fwtmp < wtmp.mmdd > wtmp.new
    

    The fwtmp command converts wtmp from binary to ASCII.

  3. Edit the ASCII wtmp.new file to delete damaged records or all records from the beginning of the file up to the needed date change by typing:

    vi wtmp.new
    
  4. Convert the ASCII wtmp.new file back to binary format by typing:

    fwtmp -ic < wtmp.new > wtmp.mmdd
    
  5. If the wtmp file is beyond repair, use the nulladm command to create an empty wtmp file. This prevents any charges in the connect time.

    nulladm wtmp
    

    The nulladm command creates the file specified with read and write permissions for the file owner and group, and read permissions for other users. It ensures that the file owner and group are adm.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]