summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2012-04-24 20:10:45 +0000
committerColin Guthrie <colin@mageia.org>2012-04-24 20:10:45 +0000
commit43ba4697a682ca16c322914147a75aeb4f5dbca3 (patch)
tree075557c961d4d712622b0702eaaca411ce39c014 /perl-install
parentdd2cd3d0db864897759577945e4cfbb174ee4d9d (diff)
downloaddrakx-43ba4697a682ca16c322914147a75aeb4f5dbca3.tar
drakx-43ba4697a682ca16c322914147a75aeb4f5dbca3.tar.gz
drakx-43ba4697a682ca16c322914147a75aeb4f5dbca3.tar.bz2
drakx-43ba4697a682ca16c322914147a75aeb4f5dbca3.tar.xz
drakx-43ba4697a682ca16c322914147a75aeb4f5dbca3.zip
services: Use systemctl to determin if a service is active under systemd.
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/services.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/perl-install/services.pm b/perl-install/services.pm
index f852fe573..f7efdc5e3 100644
--- a/perl-install/services.pm
+++ b/perl-install/services.pm
@@ -447,7 +447,11 @@ sub is_service_running ($) {
my ($service) = @_;
# Exit silently if the service is not installed
service_exists($service) or return 1;
- run_program::rooted($::prefix, "/etc/rc.d/init.d/$service", '>', '/dev/null', '2>', '/dev/null', "status");
+ if (running_systemd()) {
+ run_program::rooted($::prefix, '/bin/systemctl', '--quiet', 'is-active', "$service.service");
+ } else {
+ run_program::rooted($::prefix, '/sbin/service', $service, 'status');
+ }
}
sub starts_on_boot {