Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Nov 2001 19:04:23 +0100 (CET)
From:      Cyrille Lefevre <clefevre@citeweb.net>
To:        Brian Dean <bsd@bsdhome.com>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: rotation of lastlog
Message-ID:  <200111021804.fA2I4N697669@gits.dyndns.org>
In-Reply-To: <20011102110942.A41614@neutrino.bsdhome.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Brian Dean wrote:
> 
> Perhaps this is a dumb question, but is there any reason _not_ to have
> /var/log/lastlog be rotated via newsyslog like most other log files?

as Jim says, lastlog prabably is a sparse file. so, it don't take
so much space on disk. rotating it probably fill up those wholes.
so, it will take more space than w/o rotating it except if newsyslog
handle well sparse files, but I have a doubt about this since very
few commands handle such files right.

> I thought that maybe it was omitted because it is composed of fixed
> format data structures and rotating it at just the wrong time could
> split one of these structures, throwing off alignment.  But I see that

I think so.

> wtmp is rotated by newsyslog, which has the same issue.

there is a major difference between lastlog (or utmp) and wtmp, the
later can grow indefinitely...

> If the above is not a concern or can't happen, or there are no other
> concerns, I'd like to add it.  Any objections?

# cd /var/log
# ls -ls lastlog*
24 -rw-rw-r--  1 root  wheel  64568 Nov  2 16:44 lastlog
# cp lastlog lastlog.0
# ls -ls lastlog*
 24 -rw-rw-r--  1 root  wheel  64568 Nov  2 16:44 lastlog
 64 -rw-r--r--  1 root  wheel  64568 Nov  2 19:02 lastlog.0

did that answer your question ?

Cyrille.
-- 
Cyrille Lefevre                 mailto:clefevre@citeweb.net

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111021804.fA2I4N697669>