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 | 716694dd6f66b9f5529289a6b6eda71e4ee577e9 (patch) | |
tree | 075557c961d4d712622b0702eaaca411ce39c014 | |
parent | ef3fec41ae10bd26b95228a601ea56e233c11eda (diff) | |
download | drakx-backup-do-not-use-716694dd6f66b9f5529289a6b6eda71e4ee577e9.tar drakx-backup-do-not-use-716694dd6f66b9f5529289a6b6eda71e4ee577e9.tar.gz drakx-backup-do-not-use-716694dd6f66b9f5529289a6b6eda71e4ee577e9.tar.bz2 drakx-backup-do-not-use-716694dd6f66b9f5529289a6b6eda71e4ee577e9.tar.xz drakx-backup-do-not-use-716694dd6f66b9f5529289a6b6eda71e4ee577e9.zip |
services: Use systemctl to determin if a service is active under systemd.
-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 { |