utmp and wtmp

George Magklaras georgios at biotek.uio.no
Fri Jul 4 11:11:43 UTC 2008


The best thing in that case would be to increase the logrotate interval 
for wtmp from a monthly to yearly basis. Somewhere under /etc you should 
have an /etc/logrotate.conf file. Normally, a default entry for wtmp 
would be:

# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
     monthly
     minsize 1M
     create 0664 root utmp
     rotate 1
}

In plain English, this means "rotate the file once per month with 
priority the timestamp and not the minimum size at 1 Meg". If you 
replace the line "monthly" bit with "yearly" and take the minsize 
parameter out, it should do the job.

After that, do a: logrotate -dv /etc/logrotate.conf and verify what the 
logrotate tool is planning to do with the new parameters. It should 
verify the yearly rotation for wtmp.

Warning: Depending on how busy the system is not only wtmp/utmp log wise 
but from other logs, I normally partition /var separarely to make sure I 
have plenty of space. If you have /var under root, watch out for the 
size of the log(s).

GM

-- 
--
George Magklaras

Senior Computer Systems Engineer/UNIX Systems Administrator
EMBnet Technical Management Board
The Biotechnology Centre of Oslo,
University of Oslo
http://folk.uio.no/georgios



Paula J. Lindsay wrote:
> Hi everyone,
> I have a scientist that runs an instrument in her lab.  She uses utmp 
> and logrotate to rotate the wtmp file and then
> at the beginning of the month, she records everyone's logging in and out 
> usage on her RHE 5 machine so she
> can charge them for the use of the instrument.  Sometimes students and 
> other doctor's run experiments all night.
> Well, I have her RHE 5 machine rotating every month at the beginning of 
> the month, it does this at midnight.
> The problem is that whoever is logged in at that  time is dropped and 
> the utmp doesn't continue to record his/her
> time on the machine.  They could be on there for another 5 hours, but it 
> doesn't pick up that user again.  Is there
> any way to make the utmp pick up that user or continue recording that 
> user when the logs are processing again?
> I know this is somewhat of an irritating quirk, but it is important to 
> her to find out when the person logs back out
> so she doesn't charge him too much or too little.  Any 
> help/advice/suggestions would be greatly appreciated.  Many
> thanks in advance.
> Paula
> 






More information about the redhat-list mailing list