<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 04/17/2014 04:59 AM, Zbigniew Jędrzejewski-Szmek wrote:<br>
<blockquote cite="mid:20140417025901.GY24597@in.waw.pl" type="cite">
<pre wrap="">On Thu, Apr 17, 2014 at 01:41:51AM +0100, Djalal Harouni wrote:</pre>
<blockquote type="cite">
<pre wrap="">BTW, I've a question, why there is this item in the TODO:
"systemctl --root=container/ set-default ... is totally borked."
Can someone please shed some light on this?
</pre>
</blockquote>
<pre wrap="">I added this, and I guess I should have been more specific, because I had
to test this again, to see what is wrong :)
systemctl --root=/var/tmp/inst1 set-default multi-user.target
creates a symlink /var/tmp/inst1//usr/etc/systemd/system/default.target -> /var/tmp/inst1//lib/systemd/system/multi-user.target, i.e. leaks the container name.
</pre>
</blockquote>
<small><big><tt>If understood correctly, proper symlink should be </tt></big></small><br>
<pre wrap="">/var/tmp/inst1//usr/etc/systemd/system/default.target -> /lib/systemd/system/multi-user.target
Not appending --root prefix in unit_file_search will fix it
---
shared/install.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/shared/install.c b/shared/install.c
index 6334833..75d3455 100644
--- a/shared/install.c
+++ b/shared/install.c
@@ -1045,10 +1045,7 @@ static int unit_file_search(
STRV_FOREACH(p, paths->unit_path) {
char *path = NULL;
- if (isempty(root_dir))
- asprintf(&path, "%s/%s", *p, info->name);
- else
- asprintf(&path, "%s/%s/%s", root_dir, *p, info->name);
+ asprintf(&path, "%s/%s", *p, info->name);
if (!path)
return -ENOMEM;
--
1.9.0
</pre>
<blockquote cite="mid:20140417025901.GY24597@in.waw.pl" type="cite">
<pre wrap="">
Zbyszek
</pre>
</blockquote>
<small><font face="Courier New, Courier, monospace"></font></small>
</body>
</html>