portable: Don't refuse copying out instance of template that exists

There's no reason to refuse copying out capsule@abc.service even if
capsule@.service already exists on the host, so let's optionally not
search for templates if we can't find an instance when looking up
units and use it in portabled.
This commit is contained in:
Daan De Meyer
2026-02-03 15:03:51 +01:00
committed by Daan De Meyer
parent 4d388536ee
commit ae6dcaff0d
4 changed files with 14 additions and 13 deletions
+1 -1
View File
@@ -474,7 +474,7 @@ static int run(const char *dest, const char *dest_early, const char *dest_late)
_cleanup_free_ char *found_sshd_template_unit = NULL;
r = unit_file_exists_full(RUNTIME_SCOPE_SYSTEM, &lp,
/* follow = */ true,
SEARCH_FOLLOW_CONFIG_SYMLINKS,
"sshd@.service",
&found_sshd_template_unit);
if (r < 0)