From a1a2953d4c923a23f5df1196bbedc79ff92e15f8 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 28 Feb 2014 10:44:43 -0500 Subject: [PATCH] core: Don't make multi-user.target.wants link if it already exists --- src/rpm-ostree.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rpm-ostree.c b/src/rpm-ostree.c index 3680b678..1bc44f7e 100644 --- a/src/rpm-ostree.c +++ b/src/rpm-ostree.c @@ -839,10 +839,14 @@ main (int argc, if (!unitname) goto out; - g_print ("Adding %s to multi-user.target.wants\n", unitname); - symlink_target = g_strconcat ("/usr/lib/systemd/system/", unitname, NULL); unit_link_target = g_file_get_child (multiuser_wants_dir, unitname); + + if (g_file_query_file_type (unit_link_target, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL) == G_FILE_TYPE_SYMBOLIC_LINK) + continue; + + g_print ("Adding %s to multi-user.target.wants\n", unitname); + if (!g_file_make_symbolic_link (unit_link_target, symlink_target, cancellable, error)) goto out;