1
0
mirror of synced 2026-01-22 18:21:20 +00:00

2005-12-24 12:10:20 by steve

Pass all configuration variables to the child process, via
 environmental variables.
This commit is contained in:
steve 2005-12-24 12:10:20 +00:00
parent b57fd2a22e
commit 9c9bc103c8

View File

@ -291,7 +291,7 @@ Show the version number and exit.
--
http://www.steve.org.uk/
$Id: xen-create-image,v 1.62 2005-12-24 10:34:14 steve Exp $
$Id: xen-create-image,v 1.63 2005-12-24 12:10:20 steve Exp $
=cut
@ -942,7 +942,7 @@ sub parseCommandLineArguments
if ( $VERSION )
{
my $REVISION = '$Id: xen-create-image,v 1.62 2005-12-24 10:34:14 steve Exp $';
my $REVISION = '$Id: xen-create-image,v 1.63 2005-12-24 12:10:20 steve Exp $';
$VERSION = join (' ', (split (' ', $REVISION))[2]);
$VERSION =~ s/,v\b//;
$VERSION =~ s/(\S+)$/$1/;
@ -1486,6 +1486,15 @@ sub runHooks
{
my ( $HOOK_DIR, $prefix ) = ( @_ );
#
# Setup the environment for the child processes.
#
foreach my $key ( keys %CONFIG )
{
$ENV{$key} = $CONFIG{$key};
}
#
# Make sure that our scripts run in sorted order, as
# the user would expect.
@ -1497,9 +1506,18 @@ sub runHooks
#
if ( ( -x $file ) && ( -f $file ) )
{
print "Running hook: $file\n";
#
# Just display the name.
#
my $name = $file;
if ( $file =~ /(.*)\/(.*)/ )
{
$name = $2;
}
print "Running hook: $name\n";
runCommand( $file . " " . $prefix . " " . $CONFIG{'hostname'} );
print "Done\n";
print "Hook finished: $name\n";
}
}
}