Connect-time accounting data
Connect-time data is collected by the init command and the login command.
When you log in, the login program writes a record in the /etc/utmp file. This record includes your user name, the date and time of the login, and the login port. Commands, such as who, use this file to find out which users are logged into the various display stations. If the /var/adm/wtmp connect-time accounting file exists, the login command adds a copy of this login record to it. For information about the init and login commands, see init and login.
When your login program ends (normally when you log out), the init command records the end of the session by writing another record in the /var/adm/wtmp file. Logout records differ from login records in that they have a blank user name. Both the login and logout records have the form described in the utmp.h file. For information about the utmp.h file, see utmp.h.
The acctwtmp command also writes special entries in the /var/adm/wtmp file concerning system shutdowns and startups.