[xen-tools] Re: please mark new installs in logfile/rotate logs
Steve Kemp
steve at steve.org.uk
Wed Jun 20 00:33:09 CEST 2007
On Tue Jun 19, 2007 at 20:38:15 +0100, Henning Sprang wrote:
> Yep. After restarting this install, the last line beings to repeat.
> So, information about multiple installs is stored in one file -
> withpout being marked as such.
That seems very broken. If you check the code it is *supposed* to
truncate the logfile at startup:
xen-create-image:
#
# Trash any existing for this run logfile.
#
open( TRASH, ">", "/var/log/xen-tools/$CONFIG{'hostname'}.log" );
print TRASH "";
close(TRASH);
I'd suggest that you add somethign there to see if it is failing:
open( TRASH, ">", "/var....." ) or die "Failed to truncate /var/log/.... $!";
That might be useful.
> I'd suggest to change one of these facts: either store only data of
> one install in one file (use rotation of files, or add a timestamp to
> the name of the logile), or mark the end of the last and the start of
> a new install very clearly, with something like
>
I'd rather just truncate and recycle to be honest. Unless you can
think of a good reason to keep the logfile when the name is being
"reused".
I guess the code could be changed as such:
if ( -e "/var/log/xen-tools/$CONFIG{'hostname'}.log" )
{
print "Removing existing logfile\n" if ( $CONFIG{'verbose'} );
unlink( "var/log/xen-tools/$CONFIG{'hostname'}.log" );
}
Steve
--
# Kink-Friendly Dating
http://ctrl-alt-date.com/
More information about the xen-tools-discuss
mailing list