]> git.ipfire.org Git - thirdparty/mkosi.git/commit
Wait until sandbox exec()'s specified command before continuing 3298/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 22 Dec 2024 11:47:06 +0000 (12:47 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 22 Dec 2024 21:06:33 +0000 (22:06 +0100)
commit7dc53b10b85d57b2fe9822091137246901cacc88
treee8fc1ae83354493ddd2b24db715a8dc575acf4ec
parentdab6522cf4be040955c65eab9a192ca0d2e35e95
Wait until sandbox exec()'s specified command before continuing

Let's wait in spawn() until all setup logic has completed before
continuing if a sandbox is used. When using spawn() without run(),
this helps us fail early if the setup logic fails instead of later
on if we're not checking the result of the spawn() command immediately
afterwards.

As a side effect, this also acts as a synchronization point when using
systemd-run --scope where when spawn() returns, we can be 100% sure that
the scope has been created, which is important when calling RegisterMachine
from systemd-machined which does the wrong thing if the scope for the specified
machine does not yet exist and ends up killing the parent unit (often the user
session) instead of just the virtual machine.
mkosi/resources/man/mkosi-sandbox.1.md
mkosi/run.py
mkosi/sandbox.py