From 9b5c7eb0fd809a8805c2432e0a5252972452fd12 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 12 Feb 2003 22:56:15 +0000 Subject: cleanup starts_on_boot() --- perl-install/services.pm | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/perl-install/services.pm b/perl-install/services.pm index f3aa02e49..4f46bbbe4 100644 --- a/perl-install/services.pm +++ b/perl-install/services.pm @@ -329,22 +329,10 @@ sub is_service_running ($) { return (($? >> 8) != 0) ? 0 : 1; } -sub starts_on_boot ($) { +sub starts_on_boot { my ($service) = @_; - local *F; - open F, ($::testing ? $::prefix : "chroot $::prefix/ ") . - "/bin/sh -c \"export LC_ALL=C; /sbin/chkconfig --list $service 2>&1\" |" or - return 0; - while (my $line = ) { - chomp $line; - if (($line =~ /:on/) || # service with init script - ($line =~ /^\s*$service\s+on\s*$/)) { # xinetd service - close F; - return 1; - } - } - close F; - return 0; + my (undef, $on_services) = services($::prefix); + member($service, @$on_services); } sub start_service_on_boot ($) { -- cgit v1.2.1