[systemd-devel] [PATCH] systemctl: "systemctl --root=container/ set-default ... is totally borked."

Lennart Poettering lennart at poettering.net
Mon Apr 21 22:57:09 PDT 2014


On Thu, 17.04.14 10:40, Jan Chaloupka (jchaloup at redhat.com) wrote:

> On 04/17/2014 04:59 AM, Zbigniew Je;drzejewski-Szmek wrote:
> >On Thu, Apr 17, 2014 at 01:41:51AM +0100, Djalal Harouni wrote:
> >>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?
> >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.
> If understood correctly, proper symlink should be
> 
> /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

Hmm, we really should try to generate relative symlinks for cases like
this. This is a lot nicer when one browses through an OS tree installed
in some subdirectory, since the symlinks then point to the right files,
instead of files on the host.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list