diff options
author | Colin Guthrie <colin@mageia.org> | 2012-04-30 08:31:31 +0000 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2012-04-30 08:31:31 +0000 |
commit | 224ee96f58dfdcc51b99f22124f2a14b8151ae8b (patch) | |
tree | 1eaa62c7265bf84358dc7f6cffa14fb13266981e | |
parent | ad044050808af89c5b7af92c657e2d6c44510d4c (diff) | |
download | rpm-helper-224ee96f58dfdcc51b99f22124f2a14b8151ae8b.tar rpm-helper-224ee96f58dfdcc51b99f22124f2a14b8151ae8b.tar.gz rpm-helper-224ee96f58dfdcc51b99f22124f2a14b8151ae8b.tar.bz2 rpm-helper-224ee96f58dfdcc51b99f22124f2a14b8151ae8b.tar.xz rpm-helper-224ee96f58dfdcc51b99f22124f2a14b8151ae8b.zip |
Trust systemd install rules if avaialble, only then fall back to manual linking
-rwxr-xr-x | add-service | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/add-service b/add-service index cee3b14..0c0a887 100755 --- a/add-service +++ b/add-service @@ -230,14 +230,15 @@ else if [ -n "$enable_targets" ]; then for unit in $full_path_units; do bn_unit="$(basename $unit)" - if [[ "$bn_unit" =~ "@.service" ]]; then - # We cannot simply link template units + if grep -qE "^(WantedBy|Alias)=" $unit; then if [ x$init = xsystemd -a x$reloaded = xno ]; then /bin/systemctl --system daemon-reload reloaded=yes fi - echo 1>&2 "Migrating sysvinit service '$srv' to systemd native template unit '$bn_unit'" + echo 1>&2 "Migrating sysvinit service '$srv' to systemd native unit '$bn_unit' via systemd install rules." /bin/systemctl enable $bn_unit + elif [[ "$bn_unit" =~ "@.service" ]]; then + echo 1>&2 "Migrating sysvinit service '$srv' to systemd native template unit '$bn_unit': Failed - no install rules" else for enable_target in $enable_targets; do wantsdir=$USERUNITDIR/${enable_target}.wants |