W dniu 14.06.2022 o 10:19, Ulrich Windl pisze:
passing them wouldn't help as it would still be systemd running the service, so it would have to run it from chroot, it would be a separate feature which wouldn't be something you'd expect out of the box.Michal Zegan <webczat@xxxxxxxxxxx> schrieb am 14.06.2022 um 09:25 in Nachricht<DM4PR12MB66388D04DB6D7A76138DC8A8A0AA9@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> ...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.
this would be quite complex but doable. I am crazy enough to play with stuff like this when I am bored.
I imagine you would need to be careful so that trying to run your guest os this way won't try to do things like loading modules into the host.
another method I saw being used is running guest os in a vm if a rescue system allows installing software, but at this point you could install nspawn too and use it.
Regards, Ulrichwould be an interesting experiment to do without container software tbh.Regards, UlrichCol
Attachment:
OpenPGP_0xE6516A8A8E25955D.asc
Description: OpenPGP public key
Attachment:
OpenPGP_signature
Description: OpenPGP digital signature