diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-06-10 05:15:55 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-06-10 05:15:55 +0000 |
commit | d7ebf2b4ce80988e116d4db4f67ad52f02b658ea (patch) | |
tree | 80e20f4aa4ae312bc0eaa007fdbe9434a796f1da | |
parent | fef2c4163cbc2d8b99b540fdd5b6af351001c640 (diff) | |
download | drakx-d7ebf2b4ce80988e116d4db4f67ad52f02b658ea.tar drakx-d7ebf2b4ce80988e116d4db4f67ad52f02b658ea.tar.gz drakx-d7ebf2b4ce80988e116d4db4f67ad52f02b658ea.tar.bz2 drakx-d7ebf2b4ce80988e116d4db4f67ad52f02b658ea.tar.xz drakx-d7ebf2b4ce80988e116d4db4f67ad52f02b658ea.zip |
create enable() and disable() out of set_status()
-rw-r--r-- | perl-install/services.pm | 18 |
1 files changed, 14 insertions, 4 deletions
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); } } |