[systemd-devel] Antw: Re: Antw: Re: Antw: [EXT] Re: Q: Start network in chroot?

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Tue Jun 14 08:19:33 UTC 2022


>>> Michal Zegan <webczat at outlook.com> schrieb am 14.06.2022 um 09:25 in Nachricht
<DM4PR12MB66388D04DB6D7A76138DC8A8A0AA9 at DM4PR12MB6638.namprd12.prod.outlook.com>

...
>>> Sure when "init" was just a bundle of scripts, you could run one of the
>>> scripts it runs and hope for the best. You can generally still do that,
>>> but just don't expect asking a non-running program to do it for you to work!
>> Still I don't understand: systemd is running.
> 
> on the host. daemons usually read configuration, including service 
> files, from the place they run from. systemd is not running from chroot 
> so it will read services from outside of chroot, doing othervise would 
> be extremely weird behavior.

Thank you for this explanation; it makes sense. However (as written a moment ago) the original error messgae is not really helpful trying to understand the root cause of the issue.
But still I guess I cannot have a second systemd in chroot.

> 
> note contrary to sysvinit you are not running service scripts, but you 
> communicate with an already running systemd instance to start a service, 
> so because systemd runs from outside of chroot it cannot start a service 
> as if it was in a chroot, nor can this service read config files from 
> chroot.

OK, the problem seems to be that systemctl does not "pass" the units to systemd, but systemd "ate" (and digested) them all before.

> 
> You would literally need running systemd copy related to the chroot 
> which you cannot do without namespacing, and you would need network 
> interface in that ns.

namespaces are quite new to me. I have no experience with those.

Regards,
Ulrich

> 
> would be an interesting experiment to do without container software tbh.
> 
>>
>> Regards,
>> Ulrich
>>
>>> Col
>>
>>
>>






More information about the systemd-devel mailing list