diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2002-07-23 09:35:45 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2002-07-23 09:35:45 +0000 |
commit | e2889facfca0f6c6f64e2194f913a6b525f255e0 (patch) | |
tree | 1a6a31cac250bc7456664b1b4700587d50ca19b5 /perl-install/standalone | |
parent | 7ec6169f18805dc3b211e9604d7e318f46973ce3 (diff) | |
download | drakx-e2889facfca0f6c6f64e2194f913a6b525f255e0.tar drakx-e2889facfca0f6c6f64e2194f913a6b525f255e0.tar.gz drakx-e2889facfca0f6c6f64e2194f913a6b525f255e0.tar.bz2 drakx-e2889facfca0f6c6f64e2194f913a6b525f255e0.tar.xz drakx-e2889facfca0f6c6f64e2194f913a6b525f255e0.zip |
faster service startup
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-x | perl-install/standalone/service_harddrake | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake index 1235ae539..bfc652d13 100755 --- a/perl-install/standalone/service_harddrake +++ b/perl-install/standalone/service_harddrake @@ -1,18 +1,16 @@ #!/usr/bin/perl -w -# harddrake2 This service runs the HardDrake hardware probe. use lib qw(/usr/lib/libDrakX); use strict; use standalone; #- warning, standalone must be loaded very first, for 'explanations' use MDK::Common; -use POSIX; use interactive; use harddrake::data; -use Data::Dumper; +use Storable qw(store retrieve); my $hw_sysconfdir = "/etc/sysconfig/harddrake2"; -my $last_boot_config = "$hw_sysconfdir/previous_hw"; +my $last_boot_config = $hw_sysconfdir."/previous_hw"; my $str = '#!/usr/bin/perl -w # @@ -26,7 +24,7 @@ my $str = '#!/usr/bin/perl -w '; # first run ? if not read old hw config -my $previous_config = -f $last_boot_config ? do $last_boot_config : {}; +my %previous_config = -f $last_boot_config ? retrieve($last_boot_config) : {}; my (%config, $in); @@ -55,8 +53,8 @@ foreach (@harddrake::data::tree) { } &$detector; $config{$Ident} = \%ID; - next if is_empty_hash_ref $previous_config; - my $oldconfig = $previous_config->{$Ident}; + next if is_empty_hash_ref %previous_config; + my $oldconfig = $previous_config{$Ident}; my $msg; my @was_removed = difference2([ keys %$oldconfig ], [ keys %ID ]); @@ -86,15 +84,14 @@ foreach (@harddrake::data::tree) { print "CANCELED\n" if $res; next unless ($res); # canceled if (my $pid = fork) { + require POSIX; POSIX::wait(); } else { exec("$configurator 2>/dev/null") or die "$configurator missing\n"; } } - -$Data::Dumper::Terse = 1; # don't output names where feasible -$Data::Dumper::Purity = 1; # fill in the holes for eval # output new hw config -output("$last_boot_config", $str . Dumper(\%config) . ";\n"); +standalone::explanations "created file $last_boot_config"; +store \%config, $last_boot_config; $in->exit(0) if defined $in; exit 0; |