aboutsummaryrefslogtreecommitdiffstats
path: root/add-service
diff options
context:
space:
mode:
Diffstat (limited to 'add-service')
-rwxr-xr-xadd-service7
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