diff options
author | Dexter Morgan <dmorgan@mageia.org> | 2011-11-07 00:28:48 +0000 |
---|---|---|
committer | Dexter Morgan <dmorgan@mageia.org> | 2011-11-07 00:28:48 +0000 |
commit | 492988609a33ee8af0a0d1eb65b36be60fed4716 (patch) | |
tree | b0c20308c7200e2e8ab06262ea7c56d483799c48 /perl-install/services.pm | |
parent | 2317b8d9f1c7f15baef2bff4ebc31a5b9c30260e (diff) | |
download | drakx-492988609a33ee8af0a0d1eb65b36be60fed4716.tar drakx-492988609a33ee8af0a0d1eb65b36be60fed4716.tar.gz drakx-492988609a33ee8af0a0d1eb65b36be60fed4716.tar.bz2 drakx-492988609a33ee8af0a0d1eb65b36be60fed4716.tar.xz drakx-492988609a33ee8af0a0d1eb65b36be60fed4716.zip |
Translate the symlink as systemctl enable do not accept them
Diffstat (limited to 'perl-install/services.pm')
-rw-r--r-- | perl-install/services.pm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/perl-install/services.pm b/perl-install/services.pm index 7c6e58ed2..cc47e8076 100644 --- a/perl-install/services.pm +++ b/perl-install/services.pm @@ -13,6 +13,7 @@ use run_program; use common; use run_program; +use File::Basename; sub description { my %services = ( @@ -293,7 +294,13 @@ sub _set_service { my ($service, $enable) = @_; if ( -f "/lib/systemd/system/$service.service" ) { - run_program::rooted($::prefix, "systemctl", $enable ? "enable" : "disable", $service . ".service"); + 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); } else { |