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 | a0cc45f2d9262ac3ffbe7b2cc0b2926927459f11 (patch) | |
tree | b0c20308c7200e2e8ab06262ea7c56d483799c48 /perl-install | |
parent | 6e0ca2bbb6e18677261e3a7446a125afc692f2d0 (diff) | |
download | drakx-backup-do-not-use-a0cc45f2d9262ac3ffbe7b2cc0b2926927459f11.tar drakx-backup-do-not-use-a0cc45f2d9262ac3ffbe7b2cc0b2926927459f11.tar.gz drakx-backup-do-not-use-a0cc45f2d9262ac3ffbe7b2cc0b2926927459f11.tar.bz2 drakx-backup-do-not-use-a0cc45f2d9262ac3ffbe7b2cc0b2926927459f11.tar.xz drakx-backup-do-not-use-a0cc45f2d9262ac3ffbe7b2cc0b2926927459f11.zip |
Translate the symlink as systemctl enable do not accept them
Diffstat (limited to 'perl-install')
-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 { |