summaryrefslogtreecommitdiffstats
path: root/perl-install/services.pm
diff options
context:
space:
mode:
authorDexter Morgan <dmorgan@mageia.org>2011-11-07 00:28:48 +0000
committerDexter Morgan <dmorgan@mageia.org>2011-11-07 00:28:48 +0000
commit492988609a33ee8af0a0d1eb65b36be60fed4716 (patch)
treeb0c20308c7200e2e8ab06262ea7c56d483799c48 /perl-install/services.pm
parent2317b8d9f1c7f15baef2bff4ebc31a5b9c30260e (diff)
downloaddrakx-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.pm9
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
{