1
0
mirror of synced 2026-01-20 09:34:58 +00:00

2006-08-18 13:14:14 by steve

Reset logfile at startup time.
This commit is contained in:
steve 2006-08-18 13:14:14 +00:00
parent 94c29a35c8
commit e20a1ecd4c

View File

@ -446,7 +446,7 @@ Install an X11 server, using VNC and XDM
--
http://www.steve.org.uk/
$Id: xen-create-image,v 1.78 2006-08-18 13:10:37 steve Exp $
$Id: xen-create-image,v 1.79 2006-08-18 13:14:14 steve Exp $
=cut
@ -543,6 +543,18 @@ testRootUser();
#
checkArguments();
#
# Make sure we have a log directory
#
mkdir( "/var/log/xen-tools", 0777 ) if ( ! -d "/var/log/xen-tools" );
#
# Trash any existing logfile.
open( TRASH, ">", "/var/log/xen-tools/$CONFIG{'hostname'}.log" );
print TRASH "";
close(TRASH);
#
# Check we have installed binaries.
@ -770,6 +782,7 @@ sub setupDefaultOptions
$CONFIG{'mount_fs_ext3'} = '-t ext3';
$CONFIG{'mount_fs_xfs'} = '-t xfs';
$CONFIG{'mount_fs_reiserfs'} = '-t reiserfs';
}
@ -926,7 +939,7 @@ sub parseCommandLineArguments
if ( $VERSION )
{
my $REVISION = '$Revision: 1.78 $';
my $REVISION = '$Revision: 1.79 $';
if ( $REVISION =~ /1.([0-9.]+) / )
{
@ -1941,10 +1954,8 @@ sub logprint
print $text;
#
# Make sure we have a log directory
# Log.
#
mkdir( "/var/log/xen-tools", 0777 ) if ( ! -d "/var/log/xen-tools" );
if ( $CONFIG{'hostname'} )
{
open( LOGFILE, ">>", "/var/log/xen-tools/$CONFIG{'hostname'}.log" )