1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 23:51:28 +03:00

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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-12-19 16:55:11 +01:00
parent f9ef25a483
commit b59817b199

View File

@ -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;