summaryrefslogtreecommitdiffstats
path: root/perl-install/services.pm
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2012-04-24 20:10:38 +0000
committerColin Guthrie <colin@mageia.org>2012-04-24 20:10:38 +0000
commit806665d9b6db5d0c98f7ac47a52c82a7758492ac (patch)
tree88bf8e58237239177fb5f019ac1b0d72e636957c /perl-install/services.pm
parentf1ff46f7efbdc074536913c617e8af0cebaab1de (diff)
downloaddrakx-806665d9b6db5d0c98f7ac47a52c82a7758492ac.tar
drakx-806665d9b6db5d0c98f7ac47a52c82a7758492ac.tar.gz
drakx-806665d9b6db5d0c98f7ac47a52c82a7758492ac.tar.bz2
drakx-806665d9b6db5d0c98f7ac47a52c82a7758492ac.tar.xz
drakx-806665d9b6db5d0c98f7ac47a52c82a7758492ac.zip
services: Use systemd utility functions to determin how to handle enabling/disabling of services.
Diffstat (limited to 'perl-install/services.pm')
-rw-r--r--perl-install/services.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/perl-install/services.pm b/perl-install/services.pm
index 02a9e38c6..70c88b03d 100644
--- a/perl-install/services.pm
+++ b/perl-install/services.pm
@@ -301,14 +301,18 @@ sub ask {
sub _set_service {
my ($service, $enable) = @_;
- if (-f "/lib/systemd/system/$service.service") {
+ my @xinetd_services = map { $_->[0] } xinetd_services();
+
+ if (member($service, @xinetd_services)) {
+ run_program::rooted($::prefix, "chkconfig", $enable ? "--add" : "--del", $service);
+ } elsif (running_systemd() or has_systemd()) {
if (-l "/lib/systemd/system/$service.service") {
$service = basename(readlink("/lib/systemd/system/$service.service"));
}
else {
$service = $service . ".service";
}
- run_program::rooted($::prefix, "systemctl", $enable ? "enable" : "disable", $service);
+ run_program::rooted($::prefix, "/bin/systemctl", $enable ? "enable" : "disable", $service);
} else {
my $script = "/etc/rc.d/init.d/$service";
run_program::rooted($::prefix, "chkconfig", $enable ? "--add" : "--del", $service);