From d7ebf2b4ce80988e116d4db4f67ad52f02b658ea Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 10 Jun 2005 05:15:55 +0000 Subject: create enable() and disable() out of set_status() --- perl-install/services.pm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'perl-install') diff --git a/perl-install/services.pm b/perl-install/services.pm index 77f9b2080..e6a6c8542 100644 --- a/perl-install/services.pm +++ b/perl-install/services.pm @@ -385,14 +385,24 @@ sub do_not_start_service_on_boot ($) { run_program::rooted($::prefix, "/sbin/chkconfig", "--del", $service); } +sub enable { + my ($service, $o_dont_apply) = @_; + start_service_on_boot($service); + restart_or_start($service) unless $o_dont_apply; +} + +sub disable { + my ($service, $o_dont_apply) = @_; + do_not_start_service_on_boot($service); + stop($service) unless $o_dont_apply; +} + sub set_status { my ($service, $enable, $o_dont_apply) = @_; if ($enable) { - start_service_on_boot($service); - restart_or_start($service) unless $o_dont_apply; + enable($service, $o_dont_apply); } else { - do_not_start_service_on_boot($service); - stop($service) unless $o_dont_apply; + disable($service, $o_dont_apply); } } -- cgit v1.2.1