From 7a759bccdc48194e516e6d742cdbaa46f64a0571 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 25 Aug 2004 10:09:25 +0000 Subject: support inline configuators --- perl-install/standalone/service_harddrake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'perl-install/standalone/service_harddrake') diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake index 0ac8f2807..d8f9c742d 100755 --- a/perl-install/standalone/service_harddrake +++ b/perl-install/standalone/service_harddrake @@ -136,6 +136,8 @@ foreach my $hw_class (@harddrake::data::tree) { next; } my ($pid, $no, $res); + $hw_class->{automatic} ||= ref($configurator) eq 'CODE'; + if (!$hw_class->{automatic}) { $SIG{ALRM} = sub { $no = 1; kill 15, $pid }; unless ($pid = fork()) { @@ -149,7 +151,10 @@ foreach my $hw_class (@harddrake::data::tree) { } else { $res = 1; } - if (!$no && $res) { + if (ref($configurator) eq 'CODE') { + eval { $configurator->() }; + log::explanations(qw(cannot run "$configurator": $@)) if $@; + } elsif (!$no && $res) { foreach my $configurator (@configurator_pool) { if (fork()) { wait(); -- cgit v1.2.1