diff options
author | Colin Guthrie <colin@mageia.org> | 2012-04-24 20:10:45 +0000 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2012-04-24 20:10:45 +0000 |
commit | 43ba4697a682ca16c322914147a75aeb4f5dbca3 (patch) | |
tree | 075557c961d4d712622b0702eaaca411ce39c014 /perl-install/services.pm | |
parent | dd2cd3d0db864897759577945e4cfbb174ee4d9d (diff) | |
download | drakx-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/services.pm')
-rw-r--r-- | perl-install/services.pm | 6 |
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 { |