summaryrefslogtreecommitdiffstats
path: root/perl-install/services.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-06-10 05:15:55 +0000
committerOlivier Blin <oblin@mandriva.org>2005-06-10 05:15:55 +0000
commitd7ebf2b4ce80988e116d4db4f67ad52f02b658ea (patch)
tree80e20f4aa4ae312bc0eaa007fdbe9434a796f1da /perl-install/services.pm
parentfef2c4163cbc2d8b99b540fdd5b6af351001c640 (diff)
downloaddrakx-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()
Diffstat (limited to 'perl-install/services.pm')
-rw-r--r--perl-install/services.pm18
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);
}
}