ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
8d419f
From 7cff4a47721c2cc07648e7a84a6dee2c5e930412 Mon Sep 17 00:00:00 2001
8d419f
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
8d419f
Date: Tue, 12 Apr 2022 22:01:10 +0200
8d419f
Subject: [PATCH] Revert "shared/install: create relative symlinks for
8d419f
 enablement and aliasing"
8d419f
8d419f
This reverts commit d6c9411072901556176ac130f2ce71a33107aa93.
8d419f
8d419f
I still think this is something that needs to be done, but we're hitting some
8d419f
unexplained failures, e.g. https://github.com/systemd/systemd/issues/22920.
8d419f
So let's revert this for now, so -rc2 can be released, with a plan to return
8d419f
to this after a release.
8d419f
8d419f
Closes #22920.
8d419f
8d419f
(cherry picked from commit 9aa3d6b41eadff6634bb3cf800064724171a7aad)
8d419f
8d419f
Resolves: #2118668
8d419f
---
8d419f
 src/shared/install.c          |  14 ++--
8d419f
 src/test/test-install-root.c  |  65 ++++++++---------
8d419f
 test/test-systemctl-enable.sh | 130 ++++++++++++++++++----------------
8d419f
 3 files changed, 103 insertions(+), 106 deletions(-)
8d419f
8d419f
diff --git a/src/shared/install.c b/src/shared/install.c
8d419f
index 96d64d32bb..eb5c3d5f91 100644
8d419f
--- a/src/shared/install.c
8d419f
+++ b/src/shared/install.c
8d419f
@@ -1904,7 +1904,7 @@ static int install_info_symlink_alias(
8d419f
                 if (!alias_path)
8d419f
                         return -ENOMEM;
8d419f
 
8d419f
-                q = create_symlink(lp, info->name, alias_path, force, changes, n_changes);
8d419f
+                q = create_symlink(lp, info->path, alias_path, force, changes, n_changes);
8d419f
                 r = r < 0 ? r : q;
8d419f
         }
8d419f
 
8d419f
@@ -1973,7 +1973,7 @@ static int install_info_symlink_wants(
8d419f
         }
8d419f
 
8d419f
         STRV_FOREACH(s, list) {
8d419f
-                _cleanup_free_ char *dst = NULL;
8d419f
+                _cleanup_free_ char *path = NULL, *dst = NULL;
8d419f
 
8d419f
                 q = install_name_printf(scope, info, *s, &dst);
8d419f
                 if (q < 0) {
8d419f
@@ -2003,15 +2003,11 @@ static int install_info_symlink_wants(
8d419f
                         continue;
8d419f
                 }
8d419f
 
8d419f
-                _cleanup_free_ char *path = strjoin(config_path, "/", dst, suffix, n);
8d419f
+                path = strjoin(config_path, "/", dst, suffix, n);
8d419f
                 if (!path)
8d419f
                         return -ENOMEM;
8d419f
 
8d419f
-                _cleanup_free_ char *target = strjoin("../", info->name);
8d419f
-                if (!target)
8d419f
-                        return -ENOMEM;
8d419f
-
8d419f
-                q = create_symlink(lp, target, path, true, changes, n_changes);
8d419f
+                q = create_symlink(lp, info->path, path, true, changes, n_changes);
8d419f
                 if (r == 0)
8d419f
                         r = q;
8d419f
 
8d419f
@@ -2919,7 +2915,7 @@ int unit_file_set_default(
8d419f
                 return r;
8d419f
 
8d419f
         new_path = strjoina(lp.persistent_config, "/" SPECIAL_DEFAULT_TARGET);
8d419f
-        return create_symlink(&lp, info->name, new_path, flags & UNIT_FILE_FORCE, changes, n_changes);
8d419f
+        return create_symlink(&lp, info->path, new_path, flags & UNIT_FILE_FORCE, changes, n_changes);
8d419f
 }
8d419f
 
8d419f
 int unit_file_get_default(
8d419f
diff --git a/src/test/test-install-root.c b/src/test/test-install-root.c
8d419f
index a36536b85b..c2980ccbbd 100644
8d419f
--- a/src/test/test-install-root.c
8d419f
+++ b/src/test/test-install-root.c
8d419f
@@ -88,7 +88,7 @@ TEST(basic_mask_and_enable) {
8d419f
         assert_se(unit_file_enable(LOOKUP_SCOPE_SYSTEM, 0, root, STRV_MAKE("a.service"), &changes, &n_changes) == 1);
8d419f
         assert_se(n_changes == 1);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../a.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/a.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/a.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         unit_file_changes_free(changes, n_changes);
8d419f
@@ -128,7 +128,7 @@ TEST(basic_mask_and_enable) {
8d419f
         assert_se(unit_file_enable(LOOKUP_SCOPE_SYSTEM, 0, root, STRV_MAKE("d.service"), &changes, &n_changes) >= 0);
8d419f
         assert_se(n_changes == 1);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../a.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/a.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/a.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         unit_file_changes_free(changes, n_changes);
8d419f
@@ -147,7 +147,7 @@ TEST(basic_mask_and_enable) {
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/a.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         assert_se(changes[1].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[1].source, "../a.service"));
8d419f
+        assert_se(streq(changes[1].source, "/usr/lib/systemd/system/a.service"));
8d419f
         assert_se(streq(changes[1].path, p));
8d419f
         unit_file_changes_free(changes, n_changes);
8d419f
         changes = NULL; n_changes = 0;
8d419f
@@ -186,7 +186,7 @@ TEST(basic_mask_and_enable) {
8d419f
         assert_se(unit_file_enable(LOOKUP_SCOPE_SYSTEM, 0, root, STRV_MAKE("f.service"), &changes, &n_changes) == 1);
8d419f
         assert_se(n_changes == 2);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../f.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/f.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/x.target.wants/f.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         assert_se(changes[1].type_or_errno == UNIT_FILE_DESTINATION_NOT_PRESENT);
8d419f
@@ -280,8 +280,7 @@ TEST(linked_units) {
8d419f
         q = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/linked.service");
8d419f
         for (i = 0 ; i < n_changes; i++) {
8d419f
                 assert_se(changes[i].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-                assert_se(STR_IN_SET(changes[i].source,
8d419f
-                                     "../linked.service", "/opt/linked.service"));
8d419f
+                assert_se(streq(changes[i].source, "/opt/linked.service"));
8d419f
 
8d419f
                 if (p && streq(changes[i].path, p))
8d419f
                         p = NULL;
8d419f
@@ -323,8 +322,7 @@ TEST(linked_units) {
8d419f
         q = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/linked2.service");
8d419f
         for (i = 0 ; i < n_changes; i++) {
8d419f
                 assert_se(changes[i].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-                assert_se(STR_IN_SET(changes[i].source,
8d419f
-                                     "../linked2.service", "/opt/linked2.service"));
8d419f
+                assert_se(streq(changes[i].source, "/opt/linked2.service"));
8d419f
 
8d419f
                 if (p && streq(changes[i].path, p))
8d419f
                         p = NULL;
8d419f
@@ -342,7 +340,7 @@ TEST(linked_units) {
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
         assert_se(startswith(changes[0].path, root));
8d419f
         assert_se(endswith(changes[0].path, "linked3.service"));
8d419f
-        assert_se(streq(changes[0].source, "../linked3.service"));
8d419f
+        assert_se(streq(changes[0].source, "/opt/linked3.service"));
8d419f
         unit_file_changes_free(changes, n_changes);
8d419f
         changes = NULL; n_changes = 0;
8d419f
 }
8d419f
@@ -373,7 +371,7 @@ TEST(default) {
8d419f
         assert_se(unit_file_set_default(LOOKUP_SCOPE_SYSTEM, 0, root, "test-default.target", &changes, &n_changes) >= 0);
8d419f
         assert_se(n_changes == 1);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "test-default-real.target"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/test-default-real.target"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR "/" SPECIAL_DEFAULT_TARGET);
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         unit_file_changes_free(changes, n_changes);
8d419f
@@ -403,7 +401,7 @@ TEST(add_dependency) {
8d419f
         assert_se(unit_file_add_dependency(LOOKUP_SCOPE_SYSTEM, 0, root, STRV_MAKE("add-dependency-test-service.service"), "add-dependency-test-target.target", UNIT_WANTS, &changes, &n_changes) >= 0);
8d419f
         assert_se(n_changes == 1);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../real-add-dependency-test-service.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/real-add-dependency-test-service.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/real-add-dependency-test-target.target.wants/real-add-dependency-test-service.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         unit_file_changes_free(changes, n_changes);
8d419f
@@ -444,7 +442,7 @@ TEST(template_enable) {
8d419f
         assert_se(unit_file_enable(LOOKUP_SCOPE_SYSTEM, 0, root, STRV_MAKE("template@.service"), &changes, &n_changes) >= 0);
8d419f
         assert_se(n_changes == 1);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../template@.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/template@.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/template@def.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         unit_file_changes_free(changes, n_changes);
8d419f
@@ -475,14 +473,13 @@ TEST(template_enable) {
8d419f
 
8d419f
         assert_se(unit_file_enable(LOOKUP_SCOPE_SYSTEM, 0, root, STRV_MAKE("template@foo.service"), &changes, &n_changes) >= 0);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../template@foo.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/template@.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/template@foo.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         unit_file_changes_free(changes, n_changes);
8d419f
         changes = NULL; n_changes = 0;
8d419f
 
8d419f
-        assert_se(unit_file_get_state(LOOKUP_SCOPE_SYSTEM, root, "template@.service", &state) >= 0);
8d419f
-        assert_se(state == UNIT_FILE_INDIRECT);
8d419f
+        assert_se(unit_file_get_state(LOOKUP_SCOPE_SYSTEM, root, "template@.service", &state) >= 0 && state == UNIT_FILE_INDIRECT);
8d419f
         assert_se(unit_file_get_state(LOOKUP_SCOPE_SYSTEM, root, "template@def.service", &state) >= 0 && state == UNIT_FILE_DISABLED);
8d419f
         assert_se(unit_file_get_state(LOOKUP_SCOPE_SYSTEM, root, "template@foo.service", &state) >= 0 && state == UNIT_FILE_ENABLED);
8d419f
         assert_se(unit_file_get_state(LOOKUP_SCOPE_SYSTEM, root, "template-symlink@foo.service", &state) >= 0 && state == UNIT_FILE_ENABLED);
8d419f
@@ -509,7 +506,7 @@ TEST(template_enable) {
8d419f
 
8d419f
         assert_se(unit_file_enable(LOOKUP_SCOPE_SYSTEM, 0, root, STRV_MAKE("template-symlink@quux.service"), &changes, &n_changes) >= 0);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../template@quux.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/template@.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/template@quux.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         unit_file_changes_free(changes, n_changes);
8d419f
@@ -555,7 +552,7 @@ TEST(indirect) {
8d419f
         assert_se(unit_file_enable(LOOKUP_SCOPE_SYSTEM, 0, root, STRV_MAKE("indirectc.service"), &changes, &n_changes) >= 0);
8d419f
         assert_se(n_changes == 1);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../indirectb.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/indirectb.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/indirectb.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         unit_file_changes_free(changes, n_changes);
8d419f
@@ -607,7 +604,7 @@ TEST(preset_and_list) {
8d419f
         assert_se(unit_file_preset(LOOKUP_SCOPE_SYSTEM, 0, root, STRV_MAKE("preset-yes.service"), UNIT_FILE_PRESET_FULL, &changes, &n_changes) >= 0);
8d419f
         assert_se(n_changes == 1);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../preset-yes.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/preset-yes.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/preset-yes.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         unit_file_changes_free(changes, n_changes);
8d419f
@@ -644,7 +641,7 @@ TEST(preset_and_list) {
8d419f
         for (i = 0; i < n_changes; i++) {
8d419f
 
8d419f
                 if (changes[i].type_or_errno == UNIT_FILE_SYMLINK) {
8d419f
-                        assert_se(streq(changes[i].source, "../preset-yes.service"));
8d419f
+                        assert_se(streq(changes[i].source, "/usr/lib/systemd/system/preset-yes.service"));
8d419f
                         assert_se(streq(changes[i].path, p));
8d419f
                 } else
8d419f
                         assert_se(changes[i].type_or_errno == UNIT_FILE_UNLINK);
8d419f
@@ -760,7 +757,7 @@ TEST(preset_order) {
8d419f
         assert_se(unit_file_preset(LOOKUP_SCOPE_SYSTEM, 0, root, STRV_MAKE("prefix-1.service"), UNIT_FILE_PRESET_FULL, &changes, &n_changes) >= 0);
8d419f
         assert_se(n_changes == 1);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../prefix-1.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/prefix-1.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/prefix-1.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         unit_file_changes_free(changes, n_changes);
8d419f
@@ -869,8 +866,8 @@ TEST(with_dropin) {
8d419f
         assert_se(n_changes == 2);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
         assert_se(changes[1].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../with-dropin-1.service"));
8d419f
-        assert_se(streq(changes[1].source, "../with-dropin-1.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/with-dropin-1.service"));
8d419f
+        assert_se(streq(changes[1].source, "/usr/lib/systemd/system/with-dropin-1.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-1.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/graphical.target.wants/with-dropin-1.service");
8d419f
@@ -883,8 +880,8 @@ TEST(with_dropin) {
8d419f
         assert_se(n_changes == 2);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
         assert_se(changes[1].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../with-dropin-2.service"));
8d419f
-        assert_se(streq(changes[1].source, "../with-dropin-2.service"));
8d419f
+        assert_se(streq(changes[0].source, SYSTEM_CONFIG_UNIT_DIR"/with-dropin-2.service"));
8d419f
+        assert_se(streq(changes[1].source, SYSTEM_CONFIG_UNIT_DIR"/with-dropin-2.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-2.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/graphical.target.wants/with-dropin-2.service");
8d419f
@@ -897,8 +894,8 @@ TEST(with_dropin) {
8d419f
         assert_se(n_changes == 2);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
         assert_se(changes[1].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../with-dropin-3.service"));
8d419f
-        assert_se(streq(changes[1].source, "../with-dropin-3.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/with-dropin-3.service"));
8d419f
+        assert_se(streq(changes[1].source, "/usr/lib/systemd/system/with-dropin-3.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-3.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/graphical.target.wants/with-dropin-3.service");
8d419f
@@ -911,8 +908,8 @@ TEST(with_dropin) {
8d419f
         assert_se(n_changes == 2);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
         assert_se(changes[1].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../with-dropin-4a.service"));
8d419f
-        assert_se(streq(changes[1].source, "../with-dropin-4b.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/with-dropin-4a.service"));
8d419f
+        assert_se(streq(changes[1].source, "/usr/lib/systemd/system/with-dropin-4b.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-4a.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-4b.service");
8d419f
@@ -978,8 +975,8 @@ TEST(with_dropin_template) {
8d419f
         assert_se(n_changes == 2);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
         assert_se(changes[1].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../with-dropin-1@instance-1.service"));
8d419f
-        assert_se(streq(changes[1].source, "../with-dropin-1@instance-1.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/with-dropin-1@.service"));
8d419f
+        assert_se(streq(changes[1].source, "/usr/lib/systemd/system/with-dropin-1@.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-1@instance-1.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/graphical.target.wants/with-dropin-1@instance-1.service");
8d419f
@@ -991,8 +988,8 @@ TEST(with_dropin_template) {
8d419f
         assert_se(n_changes == 2);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
         assert_se(changes[1].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../with-dropin-2@instance-1.service"));
8d419f
-        assert_se(streq(changes[1].source, "../with-dropin-2@instance-1.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/with-dropin-2@.service"));
8d419f
+        assert_se(streq(changes[1].source, "/usr/lib/systemd/system/with-dropin-2@.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-2@instance-1.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/graphical.target.wants/with-dropin-2@instance-1.service");
8d419f
@@ -1003,7 +1000,7 @@ TEST(with_dropin_template) {
8d419f
         assert_se(unit_file_enable(LOOKUP_SCOPE_SYSTEM, 0, root, STRV_MAKE("with-dropin-2@instance-2.service"), &changes, &n_changes) == 1);
8d419f
         assert_se(n_changes == 1);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../with-dropin-2@instance-2.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/with-dropin-2@.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-2@instance-2.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         unit_file_changes_free(changes, n_changes);
8d419f
@@ -1012,7 +1009,7 @@ TEST(with_dropin_template) {
8d419f
         assert_se(unit_file_enable(LOOKUP_SCOPE_SYSTEM, 0, root, STRV_MAKE("with-dropin-3@.service"), &changes, &n_changes) == 1);
8d419f
         assert_se(n_changes == 1);
8d419f
         assert_se(changes[0].type_or_errno == UNIT_FILE_SYMLINK);
8d419f
-        assert_se(streq(changes[0].source, "../with-dropin-3@.service"));
8d419f
+        assert_se(streq(changes[0].source, "/usr/lib/systemd/system/with-dropin-3@.service"));
8d419f
         p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-3@instance-2.service");
8d419f
         assert_se(streq(changes[0].path, p));
8d419f
         unit_file_changes_free(changes, n_changes);
8d419f
diff --git a/test/test-systemctl-enable.sh b/test/test-systemctl-enable.sh
8d419f
index ac1bcc1cc7..0f9f220571 100644
8d419f
--- a/test/test-systemctl-enable.sh
8d419f
+++ b/test/test-systemctl-enable.sh
8d419f
@@ -90,27 +90,27 @@ EOF
8d419f
 ( ! "$systemctl" --root="$root" enable test1 )
8d419f
 test -h "$root/etc/systemd/system/default.target.wants/test1.service"
8d419f
 test -h "$root/etc/systemd/system/special.target.requires/test1.service"
8d419f
-test -e "$root/etc/systemd/system/test1-goodalias.service"
8d419f
+test ! -e "$root/etc/systemd/system/test1-goodalias.service"
8d419f
 test -h "$root/etc/systemd/system/test1-goodalias.service"
8d419f
-test ! -h "$root/etc/systemd/system/test1@badalias.service"
8d419f
-test ! -h "$root/etc/systemd/system/test1-badalias.target"
8d419f
-test ! -h "$root/etc/systemd/system/test1-badalias.socket"
8d419f
-test -e "$root/etc/systemd/system/test1-goodalias2.service"
8d419f
+test ! -e "$root/etc/systemd/system/test1@badalias.service"
8d419f
+test ! -e "$root/etc/systemd/system/test1-badalias.target"
8d419f
+test ! -e "$root/etc/systemd/system/test1-badalias.socket"
8d419f
 test -h "$root/etc/systemd/system/test1-goodalias2.service"
8d419f
 
8d419f
 : '-------aliases in reeanble----------------------------------'
8d419f
 ( ! "$systemctl" --root="$root" reenable test1 )
8d419f
-islink "$root/etc/systemd/system/default.target.wants/test1.service" "../test1.service"
8d419f
-islink "$root/etc/systemd/system/test1-goodalias.service" "test1.service"
8d419f
+test -h "$root/etc/systemd/system/default.target.wants/test1.service"
8d419f
+test ! -e "$root/etc/systemd/system/test1-goodalias.service"
8d419f
+test -h "$root/etc/systemd/system/test1-goodalias.service"
8d419f
 
8d419f
-test ! -h "$root/etc/systemd/system/test1@badalias.service"
8d419f
-test ! -h "$root/etc/systemd/system/test1-badalias.target"
8d419f
-test ! -h "$root/etc/systemd/system/test1-badalias.socket"
8d419f
+test ! -e "$root/etc/systemd/system/test1@badalias.service"
8d419f
+test ! -e "$root/etc/systemd/system/test1-badalias.target"
8d419f
+test ! -e "$root/etc/systemd/system/test1-badalias.socket"
8d419f
 
8d419f
 "$systemctl" --root="$root" disable test1
8d419f
-test ! -h "$root/etc/systemd/system/default.target.wants/test1.service"
8d419f
-test ! -h "$root/etc/systemd/system/special.target.requires/test1.service"
8d419f
-test ! -h "$root/etc/systemd/system/test1-goodalias.service"
8d419f
+test ! -e "$root/etc/systemd/system/default.target.wants/test1.service"
8d419f
+test ! -e "$root/etc/systemd/system/special.target.requires/test1.service"
8d419f
+test ! -e "$root/etc/systemd/system/test1-goodalias.service"
8d419f
 
8d419f
 : '-------aliases when link already exists---------------------'
8d419f
 cat >"$root/etc/systemd/system/test1a.service" <
8d419f
@@ -201,17 +201,17 @@ test ! -e "$root/etc/systemd/system/link1.path"
8d419f
 : '-------link and enable--------------------------------------'
8d419f
 "$systemctl" --root="$root" enable '/link1.path'
8d419f
 islink "$root/etc/systemd/system/link1.path" "/link1.path"
8d419f
-islink "$root/etc/systemd/system/paths.target.wants/link1.path" "../link1.path"
8d419f
+islink "$root/etc/systemd/system/paths.target.wants/link1.path" "/link1.path"
8d419f
 
8d419f
 : '-------enable already linked same path----------------------'
8d419f
 "$systemctl" --root="$root" enable '/link1.path'
8d419f
 islink "$root/etc/systemd/system/link1.path" "/link1.path"
8d419f
-islink "$root/etc/systemd/system/paths.target.wants/link1.path" "../link1.path"
8d419f
+islink "$root/etc/systemd/system/paths.target.wants/link1.path" "/link1.path"
8d419f
 
8d419f
 : '-------enable already linked different path-----------------'
8d419f
 ( ! "$systemctl" --root="$root" enable '/subdir/link1.path' )
8d419f
 islink "$root/etc/systemd/system/link1.path" "/link1.path"
8d419f
-islink "$root/etc/systemd/system/paths.target.wants/link1.path" "../link1.path"
8d419f
+islink "$root/etc/systemd/system/paths.target.wants/link1.path" "/link1.path"
8d419f
 
8d419f
 : '-------enable bad suffix------------------------------------'
8d419f
 cp "$root/link1.path" "$root/subdir/link1.suffix"
8d419f
@@ -240,11 +240,11 @@ test ! -h "$root/etc/systemd/system/paths.target.wants/link1.path"
8d419f
 
8d419f
 "$systemctl" --root="$root" enable 'link1.path'
8d419f
 islink "$root/etc/systemd/system/link1.path" "/link1.path"
8d419f
-islink "$root/etc/systemd/system/paths.target.wants/link1.path" "../link1.path"
8d419f
+islink "$root/etc/systemd/system/paths.target.wants/link1.path" "/link1.path"
8d419f
 
8d419f
 "$systemctl" --root="$root" reenable 'link1.path'
8d419f
 islink "$root/etc/systemd/system/link1.path" "/link1.path"
8d419f
-islink "$root/etc/systemd/system/paths.target.wants/link1.path" "../link1.path"
8d419f
+islink "$root/etc/systemd/system/paths.target.wants/link1.path" "/link1.path"
8d419f
 
8d419f
 : '-------manual link------------------------------------------'
8d419f
 cat >"$root/link3.suffix" <
8d419f
@@ -257,7 +257,7 @@ ln -s "/link3.suffix" "$root/etc/systemd/system/link3.service"
8d419f
 
8d419f
 SYSTEMD_LOG_LEVEL=debug SYSTEMD_LOG_LOCATION=1 "$systemctl" --root="$root" enable 'link3.service'
8d419f
 islink "$root/etc/systemd/system/link3.service" "/link3.suffix"
8d419f
-islink "$root/etc/systemd/system/services.target.wants/link3.service" "../link3.service"
8d419f
+islink "$root/etc/systemd/system/services.target.wants/link3.service" "/link3.suffix"
8d419f
 
8d419f
 SYSTEMD_LOG_LEVEL=debug SYSTEMD_LOG_LOCATION=1 "$systemctl" --root="$root" disable 'link3.service'
8d419f
 test ! -h "$root/etc/systemd/system/link3.service"
8d419f
@@ -293,7 +293,7 @@ test ! -h "$root/etc/systemd/system/services.target.wants/link5-also.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" enable 'link5-also.service'
8d419f
 test ! -h "$root/etc/systemd/system/services.target.wants/link5.service"
8d419f
-islink "$root/etc/systemd/system/services.target.wants/link5-also.service" "../link5-also.service"
8d419f
+islink "$root/etc/systemd/system/services.target.wants/link5-also.service" "/etc/systemd/system/link5-also.service"
8d419f
 
8d419f
 : '-------template enablement----------------------------------'
8d419f
 cat >"$root/etc/systemd/system/templ1@.service" <
8d419f
@@ -307,17 +307,17 @@ test ! -h "$root/etc/systemd/system/services.target.wants/templ1@.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" enable 'templ1@one.service'
8d419f
 test ! -h "$root/etc/systemd/system/services.target.wants/templ1@.service"
8d419f
-islink "$root/etc/systemd/system/services.target.wants/templ1@one.service" "../templ1@one.service"
8d419f
+islink "$root/etc/systemd/system/services.target.wants/templ1@one.service" "/etc/systemd/system/templ1@.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" enable 'templ1@two.service'
8d419f
 test ! -h "$root/etc/systemd/system/services.target.wants/templ1@.service"
8d419f
-islink "$root/etc/systemd/system/services.target.wants/templ1@one.service" "../templ1@one.service"
8d419f
-islink "$root/etc/systemd/system/services.target.wants/templ1@two.service" "../templ1@two.service"
8d419f
+islink "$root/etc/systemd/system/services.target.wants/templ1@one.service" "/etc/systemd/system/templ1@.service"
8d419f
+islink "$root/etc/systemd/system/services.target.wants/templ1@two.service" "/etc/systemd/system/templ1@.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" disable 'templ1@one.service'
8d419f
 test ! -h "$root/etc/systemd/system/services.target.wants/templ1@.service"
8d419f
 test ! -h "$root/etc/systemd/system/services.target.wants/templ1@one.service"
8d419f
-islink "$root/etc/systemd/system/services.target.wants/templ1@two.service" "../templ1@two.service"
8d419f
+islink "$root/etc/systemd/system/services.target.wants/templ1@two.service" "/etc/systemd/system/templ1@.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" disable 'templ1@two.service'
8d419f
 test ! -h "$root/etc/systemd/system/services.target.wants/templ1@.service"
8d419f
@@ -335,33 +335,33 @@ EOF
8d419f
 
8d419f
 "$systemctl" --root="$root" enable 'templ1@.service'
8d419f
 test ! -h "$root/etc/systemd/system/services.target.wants/templ1@.service"
8d419f
-islink "$root/etc/systemd/system/services.target.wants/templ1@333.service" "../templ1@.service"
8d419f
-islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@333.service" "../templ1@.service"
8d419f
+islink "$root/etc/systemd/system/services.target.wants/templ1@333.service" "/etc/systemd/system/templ1@.service"
8d419f
+islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@333.service" "/etc/systemd/system/templ1@.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" enable 'templ1@one.service'
8d419f
 test ! -h "$root/etc/systemd/system/services.target.wants/templ1@.service"
8d419f
-islink "$root/etc/systemd/system/services.target.wants/templ1@333.service" "../templ1@.service"
8d419f
-islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@333.service" "../templ1@.service"
8d419f
-islink "$root/etc/systemd/system/services.target.wants/templ1@one.service" "../templ1@one.service"
8d419f
-islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@one.service" "../templ1@one.service"
8d419f
+islink "$root/etc/systemd/system/services.target.wants/templ1@333.service" "/etc/systemd/system/templ1@.service"
8d419f
+islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@333.service" "/etc/systemd/system/templ1@.service"
8d419f
+islink "$root/etc/systemd/system/services.target.wants/templ1@one.service" "/etc/systemd/system/templ1@.service"
8d419f
+islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@one.service" "/etc/systemd/system/templ1@.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" enable 'templ1@two.service'
8d419f
 test ! -h "$root/etc/systemd/system/services.target.wants/templ1@.service"
8d419f
-islink "$root/etc/systemd/system/services.target.wants/templ1@333.service" "../templ1@.service"
8d419f
-islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@333.service" "../templ1@.service"
8d419f
-islink "$root/etc/systemd/system/services.target.wants/templ1@one.service" "../templ1@one.service"
8d419f
-islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@one.service" "../templ1@one.service"
8d419f
-islink "$root/etc/systemd/system/services.target.wants/templ1@two.service" "../templ1@two.service"
8d419f
-islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@two.service" "../templ1@two.service"
8d419f
+islink "$root/etc/systemd/system/services.target.wants/templ1@333.service" "/etc/systemd/system/templ1@.service"
8d419f
+islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@333.service" "/etc/systemd/system/templ1@.service"
8d419f
+islink "$root/etc/systemd/system/services.target.wants/templ1@one.service" "/etc/systemd/system/templ1@.service"
8d419f
+islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@one.service" "/etc/systemd/system/templ1@.service"
8d419f
+islink "$root/etc/systemd/system/services.target.wants/templ1@two.service" "/etc/systemd/system/templ1@.service"
8d419f
+islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@two.service" "/etc/systemd/system/templ1@.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" disable 'templ1@one.service'
8d419f
 test ! -h "$root/etc/systemd/system/services.target.wants/templ1@.service"
8d419f
-islink "$root/etc/systemd/system/services.target.wants/templ1@333.service" "../templ1@.service"
8d419f
-islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@333.service" "../templ1@.service"
8d419f
+islink "$root/etc/systemd/system/services.target.wants/templ1@333.service" "/etc/systemd/system/templ1@.service"
8d419f
+islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@333.service" "/etc/systemd/system/templ1@.service"
8d419f
 test ! -h "$root/etc/systemd/system/services.target.wants/templ1@one.service"
8d419f
 test ! -h "$root/etc/systemd/system/other@templ1.target.requires/templ1@one.service"
8d419f
-islink "$root/etc/systemd/system/services.target.wants/templ1@two.service" "../templ1@two.service"
8d419f
-islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@two.service" "../templ1@two.service"
8d419f
+islink "$root/etc/systemd/system/services.target.wants/templ1@two.service" "/etc/systemd/system/templ1@.service"
8d419f
+islink "$root/etc/systemd/system/other@templ1.target.requires/templ1@two.service" "/etc/systemd/system/templ1@.service"
8d419f
 
8d419f
 # disable remaining links here
8d419f
 "$systemctl" --root="$root" disable 'templ1@.service'
8d419f
@@ -400,18 +400,18 @@ RequiredBy=another-template@.target
8d419f
 EOF
8d419f
 
8d419f
 "$systemctl" --root="$root" enable 'templ2@.service'
8d419f
-islink "$root/etc/systemd/system/another-template@.target.requires/templ2@.service" "../templ2@.service"
8d419f
+islink "$root/etc/systemd/system/another-template@.target.requires/templ2@.service" "/etc/systemd/system/templ2@.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" enable 'templ2@two.service'
8d419f
-islink "$root/etc/systemd/system/another-template@.target.requires/templ2@.service" "../templ2@.service"
8d419f
-islink "$root/etc/systemd/system/another-template@.target.requires/templ2@two.service" "../templ2@two.service"
8d419f
+islink "$root/etc/systemd/system/another-template@.target.requires/templ2@.service" "/etc/systemd/system/templ2@.service"
8d419f
+islink "$root/etc/systemd/system/another-template@.target.requires/templ2@two.service" "/etc/systemd/system/templ2@.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" disable 'templ2@other.service'
8d419f
-islink "$root/etc/systemd/system/another-template@.target.requires/templ2@.service" "../templ2@.service"
8d419f
-islink "$root/etc/systemd/system/another-template@.target.requires/templ2@two.service" "../templ2@two.service"
8d419f
+islink "$root/etc/systemd/system/another-template@.target.requires/templ2@.service" "/etc/systemd/system/templ2@.service"
8d419f
+islink "$root/etc/systemd/system/another-template@.target.requires/templ2@two.service" "/etc/systemd/system/templ2@.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" disable 'templ2@two.service'
8d419f
-islink "$root/etc/systemd/system/another-template@.target.requires/templ2@.service" "../templ2@.service"
8d419f
+islink "$root/etc/systemd/system/another-template@.target.requires/templ2@.service" "/etc/systemd/system/templ2@.service"
8d419f
 test ! -h "$root/etc/systemd/system/another-template@.target.requires/templ2@two.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" disable 'templ2@.service'
8d419f
@@ -433,8 +433,8 @@ EOF
8d419f
 test ! -h "$root/etc/systemd/system/link4.service"  # this is our file
8d419f
 test ! -h "$root/etc/systemd/system/link4@.service"
8d419f
 test ! -h "$root/etc/systemd/system/link4@inst.service"
8d419f
-islink "$root/etc/systemd/system/link4alias.service" "link4.service"
8d419f
-islink "$root/etc/systemd/system/link4alias2.service" "link4.service"
8d419f
+islink "$root/etc/systemd/system/link4alias.service" "/etc/systemd/system/link4.service"
8d419f
+islink "$root/etc/systemd/system/link4alias2.service" "/etc/systemd/system/link4.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" disable 'link4.service'
8d419f
 test ! -h "$root/etc/systemd/system/link4.service"
8d419f
@@ -453,8 +453,8 @@ EOF
8d419f
 # Apparently this works. I'm not sure what to think.
8d419f
 "$systemctl" --root="$root" enable '/etc/systemd/system/link4.service'
8d419f
 test ! -h "$root/etc/systemd/system/link4.service"  # this is our file
8d419f
-islink "$root/etc/systemd/system/link4alias.service" "link4.service"
8d419f
-islink "$root/etc/systemd/system/link4alias2.service" "link4.service"
8d419f
+islink "$root/etc/systemd/system/link4alias.service" "/etc/systemd/system/link4.service"
8d419f
+islink "$root/etc/systemd/system/link4alias2.service" "/etc/systemd/system/link4.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" disable '/etc/systemd/system/link4.service'
8d419f
 test ! -h "$root/etc/systemd/system/link4.service"
8d419f
@@ -472,8 +472,8 @@ EOF
8d419f
 
8d419f
 "$systemctl" --root="$root" enable 'link5.service'
8d419f
 test ! -h "$root/etc/systemd/system/link5.service"  # this is our file
8d419f
-islink "$root/etc/systemd/system/link5alias.service" "link5.service"
8d419f
-islink "$root/etc/systemd/system/link5alias2.service" "link5.service"
8d419f
+islink "$root/etc/systemd/system/link5alias.service" "/etc/systemd/system/link5.service"
8d419f
+islink "$root/etc/systemd/system/link5alias2.service" "/etc/systemd/system/link5.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" disable 'link5.service'
8d419f
 test ! -h "$root/etc/systemd/system/link5alias.service"
8d419f
@@ -495,6 +495,10 @@ islink "$root/etc/systemd/system/link5copy.service" '/link5copy.service'
8d419f
 test ! -h "$root/etc/systemd/system/link5alias.service"
8d419f
 test ! -h "$root/etc/systemd/system/link5alias2.service"
8d419f
 
8d419f
+# FIXME: we must create link5alias2 and link5alias as relative links to link5.service
8d419f
+# When they are independent links to /link5.service, systemd doesn't know that
8d419f
+# they are aliases, because we do not follow symlinks outside of the search paths.
8d419f
+
8d419f
 "$systemctl" --root="$root" disable 'link5copy.service'
8d419f
 test ! -h "$root/etc/systemd/system/link5copy.service"
8d419f
 test ! -h "$root/etc/systemd/system/link5alias.service"
8d419f
@@ -502,8 +506,8 @@ test ! -h "$root/etc/systemd/system/link5alias2.service"
8d419f
 
8d419f
 "$systemctl" --root="$root" enable '/link5copy.service'
8d419f
 islink "$root/etc/systemd/system/link5copy.service" '/link5copy.service'
8d419f
-islink "$root/etc/systemd/system/link5alias.service" 'link5copy.service'
8d419f
-islink "$root/etc/systemd/system/link5alias2.service" 'link5copy.service'
8d419f
+islink "$root/etc/systemd/system/link5alias.service" '/link5copy.service'
8d419f
+islink "$root/etc/systemd/system/link5alias2.service" '/link5copy.service'
8d419f
 
8d419f
 "$systemctl" --root="$root" disable 'link5copy.service'
8d419f
 test ! -h "$root/etc/systemd/system/link5copy.service"
8d419f
@@ -522,10 +526,10 @@ EOF
8d419f
 
8d419f
 "$systemctl" --root="$root" enable 'link5@.path'
8d419f
 test ! -h "$root/etc/systemd/system/link5@.path"  # this is our file
8d419f
-islink "$root/etc/systemd/system/target5@.target.wants/link5@.path" "../link5@.path"
8d419f
-islink "$root/etc/systemd/system/target5@.target.requires/link5@.path" "../link5@.path"
8d419f
-islink "$root/etc/systemd/system/target5@inst.target.wants/link5@.path" "../link5@.path"
8d419f
-islink "$root/etc/systemd/system/target5@inst.target.requires/link5@.path" "../link5@.path"
8d419f
+islink "$root/etc/systemd/system/target5@.target.wants/link5@.path" "/etc/systemd/system/link5@.path"
8d419f
+islink "$root/etc/systemd/system/target5@.target.requires/link5@.path" "/etc/systemd/system/link5@.path"
8d419f
+islink "$root/etc/systemd/system/target5@inst.target.wants/link5@.path" "/etc/systemd/system/link5@.path"
8d419f
+islink "$root/etc/systemd/system/target5@inst.target.requires/link5@.path" "/etc/systemd/system/link5@.path"
8d419f
 
8d419f
 "$systemctl" --root="$root" disable 'link5@.path'
8d419f
 test ! -h "$root/etc/systemd/system/link5@.path"  # this is our file
8d419f
@@ -564,7 +568,7 @@ check_alias() {
8d419f
 Alias=target@$1:%$1.socket
8d419f
 EOF
8d419f
     SYSTEMD_LOG_LEVEL=debug "$systemctl" --root="$root" enable 'some-some-link6@.socket' || return 1
8d419f
-    islink "$root/etc/systemd/system/target@$1:$2.socket" "some-some-link6@.socket" || return 2
8d419f
+    islink "$root/etc/systemd/system/target@$1:$2.socket" "/etc/systemd/system/some-some-link6@.socket" || return 2
8d419f
 }
8d419f
 
8d419f
 # TODO: our architecture names are different than what uname -m returns.
8d419f
@@ -669,10 +673,10 @@ RequiredBy=another-target2@.target
8d419f
 EOF
8d419f
 
8d419f
 "$systemctl" --root="$root" enable 'some-some-link7.socket'
8d419f
-islink "$root/etc/systemd/system/target@some-some-link7.target.wants/some-some-link7.socket" "../some-some-link7.socket"
8d419f
-islink "$root/etc/systemd/system/another-target@.target.wants/some-some-link7.socket" "../some-some-link7.socket"
8d419f
-islink "$root/etc/systemd/system/target2@some-some-link7.target.requires/some-some-link7.socket" "../some-some-link7.socket"
8d419f
-islink "$root/etc/systemd/system/another-target2@.target.requires/some-some-link7.socket" "../some-some-link7.socket"
8d419f
+islink "$root/etc/systemd/system/target@some-some-link7.target.wants/some-some-link7.socket" "/etc/systemd/system/some-some-link7.socket"
8d419f
+islink "$root/etc/systemd/system/another-target@.target.wants/some-some-link7.socket" "/etc/systemd/system/some-some-link7.socket"
8d419f
+islink "$root/etc/systemd/system/target2@some-some-link7.target.requires/some-some-link7.socket" "/etc/systemd/system/some-some-link7.socket"
8d419f
+islink "$root/etc/systemd/system/another-target2@.target.requires/some-some-link7.socket" "/etc/systemd/system/some-some-link7.socket"
8d419f
 
8d419f
 "$systemctl" --root="$root" disable 'some-some-link7.socket'
8d419f
 test ! -h "$root/etc/systemd/system/target@some-some-link7.target.wants/some-some-link7.socket"