summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-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);