Wtmp not updating
---------------------------------------------------------------#! /bin/sh## wtmp .truncate (/usr/adm/wtmp.truncate) -# truncate old records off of wtmp and wtmpx### This script was written by David Lindes, [email protected]# (c) Copyright 1994 by David Lindes.## Permission to copy this script as wanted/needed is granted,# provided that it is distributed in its ENTIRETY, including# this copyright notice and disclaimer, all comments, and the# complete script.
Modifications may be made to the default# values of the TMPDIR, WDIR, KEEP and FILES variables, but any# other modifications will be considered a violation of the# copyright agreement.## No distribution of this script should be for any monetary or# compensatory charge without prior written consent of the# author.## The default values given were written for the Solaris 2.3# (Sun OS 5.3) operating system, and should be verified before# use on any other operating system.## NO GUARANTEE IS GRANTED AS TO THE BEHAVIOR OF THIS SCRIPT, AND# NO WARRANTY SHALL BE ISSUED, IMPLIEDOR OTHERWISE, BY THE AUTHOR,# BY SUN MICROSYSTEMS, OR BY ANY OTHER INDIVIDUAL OR COMPANY.## USE THIS SCRIPT AT YOUR OWN RISK!!!!
There are related mechanism like consolekit in place in Debian that can provide a list of currently logged in users, so the question is also if it is enough to only update consolekit, or if utmp must be updated too.
Als u een van de VAIO-computermodellen vermeld onder deze mededeling gebruikt, klik dan hier om te controleren of uw batterijen tot de getroffen eenheden behoren.
It is not the first time I meet this view, so he is not the only one believing utmp and wtmp are not really no longer important pieces of a Unix like system.
The debian policy manual have this to say about utmp and wtmp: 11.3 Using pseudo-ttys and modifying wtmp, utmp and lastlog Some programs need to create pseudo-ttys.
The last command looks in the /var/adm/wtmpx file, whichrecords all logins and logouts, for information about auser, a terminal, or any group of users and terminals. To shorten the files only partially, use the dd command with the skipand ibs arguments to tell dd how many records to skip, and how long eachrecord is, respectively.
But my view is not shared by everyone, as for example can be seen in , where the maintainer of lightdm believe correctly updated utmp information is nice to have but not a requirement.
For normal logins one of the programs processing the login (getty/login, sshd, ftpd) is responsible for updating it.
On a reboot a new reboot entry is written and a timestamp is written for the old one.
The script below will automatically shorten the files, so there is noneed to use dd directly.
Note: Given an argument of 0, this script will also empty the file, if so desired.