vmspawn: by default, let machined register a cgroup for VMs

This mimics what we do in nspawn: if registration is enabled we'll let
machined allocate a scope unit for us. When --keep-unit is used we'll
register without creating a new scope.

This brings behaviour more inline with what nspawn does, exposing the
same sets of options.
This commit is contained in:
Lennart Poettering
2024-06-21 17:49:26 +02:00
parent e16be05858
commit ecc4287dee
4 changed files with 24 additions and 5 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ if ! systemd-detect-virt -c; then
-p DelegateSubgroup=supervisor \
-p Environment=SYSTEMD_LOG_LEVEL=debug \
--wait -- \
systemd-nspawn --keep-unit -i /var/tmp/unpriv.raw --read-only --pipe echo thisisatest >/tmp/unpriv.out2
systemd-nspawn --keep-unit --register=no -i /var/tmp/unpriv.raw --read-only --pipe echo thisisatest >/tmp/unpriv.out2
echo thisisatest | cmp /tmp/unpriv.out2 -
fi