From: Zbigniew Jędrzejewski-Szmek Date: Thu, 19 Dec 2019 15:55:11 +0000 (+0100) Subject: shared/install: drop creation of alias for DefaultInstance X-Git-Tag: v245-rc1~137^2~4 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=b59817b199f3613c63cef36db63986b621dfc92a;p=systemd%2F.git shared/install: drop creation of alias for DefaultInstance It turns out that this is not necessary. When we try to resolve alias@inst, we first check alias@inst, and if that is not found, fall back to alias@. Since we already created a symlink for alias@, we will find that and the result will be the same. --- diff --git a/src/shared/install.c b/src/shared/install.c index 236f9a6e59..df9f92bddc 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -1788,22 +1788,6 @@ static int install_info_symlink_alias( q = create_symlink(paths, i->path, alias_path, force, changes, n_changes); if (r == 0) r = q; - - /* if we are a template with a DefaultInstance and we target a template, also create a link from the DefaultInstance*/ - if (unit_name_is_valid(i->name, UNIT_NAME_TEMPLATE) && unit_name_is_valid(dst, UNIT_NAME_TEMPLATE) && i->default_instance) { - _cleanup_free_ char *s_copy = NULL,*final_path = NULL; - - q = unit_name_replace_instance(dst,i->default_instance,&s_copy); - if (q < 0) - return q; - final_path = path_make_absolute(s_copy, config_path); - if (!final_path) - return -ENOMEM; - q = create_symlink(paths, i->path, final_path, force, changes, n_changes); - if (r == 0) - r = q; - } - } return r;