/var/log/wtmp always reseting to 0

Garance A Drosihn drosih at rpi.edu
Fri Oct 1 17:58:58 PDT 2004


At 6:52 PM -0400 10/1/04, questions wrote:
>On Fri, 1 Oct 2004, Richard Lynch wrote:
>
>>  man logrotate
>>
>  > Probably the logs are getting rotated and old ones discarded.
>
>    man logrotate does nothing

On FreeBSD, the utility is called newsyslog.
The entry would be in /etc/newsyslog.conf .
You should have an entry in there for /var/log/wtmp, but all that
will do is rotate the file.  It isn't going to truncate it.


>__________Snip Command Output_____
>    $ cd /var/log
>    $ ls -al wtmp*
>    -rw-r--r--  1 root  wheel  308 Oct  1 18:34 wtmp
>    -rw-r--r--  1 root  wheel    0 Oct  1 05:48 wtmp.0
>    -rw-r--r--  1 root  wheel    0 Oct  1 05:42 wtmp.1
>    -rw-r--r--  1 root  wheel    0 Oct  1 05:36 wtmp.2
>    -rw-r--r--  1 root  wheel    0 Oct  1 05:30 wtmp.3
>    $
>_______End Snip__________________

Uh, it seems odd that all those files have a date of "Oct 1".
newsyslog should only rotate the file once on any given day,
not five times, once every six minutes.  Did someone change the
entry for newsyslog in /etc/crontab ?  The only reference to
newsyslog in /etc/crontab should look like:

# Rotate log files every hour, if necessary.
0       *       *       *       *       root    newsyslog

-- 
Garance Alistair Drosehn            =   gad at gilead.netel.rpi.edu
Senior Systems Programmer           or  gad at freebsd.org
Rensselaer Polytechnic Institute    or  drosih at rpi.edu


More information about the freebsd-questions mailing list