Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qemu: wait for process to be in scope before registering with machined
Otherwise if we are unlucky with the timing and the process is added to the scope after the register request is processed, machined will register as the unit the user session scope, and it will kill it once the machine goes away, breaking the testbed/user session. root@host:~# cat /run/systemd/machines/TEST-64-UDEV-STORAGE-long-sysfs-path-1 NAME=TEST-64-UDEV-STORAGE-long-sysfs-path-1 SCOPE=session-2.scope SERVICE=mkosi LEADER=23160 CLASS=vm REALTIME=1734823438361409 MONOTONIC=11697737480 [ 340.373454] systemd-machined[21797]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.13 path=n/a interface=n/a member=n/a cookie=12 reply_cookie=22 signature=u error-name=n/a error> [ 340.373533] systemd-machined[21797]: Sent message type=error sender=n/a destination=:1.24 path=n/a interface=n/a member=n/a cookie=23 reply_cookie=2 signature=s error-name=org.freedesktop.DBus.Error.FileExis> [ 340.373537] systemd-machined[21797]: Failed to process message type=method_call sender=:1.24 destination=org.freedesktop.machine1 path=/org/freedesktop/machine1 interface=org.freedesktop.machine1.Manager mem> [ 340.373657] busctl[21800]: ‣ Type=method_call Endian=l Flags=0 Version=1 Cookie=24 Timestamp="Sat 2024-12-21 20:14:40.997553 UTC" [ 340.373657] busctl[21800]: Sender=:1.13 Destination=org.freedesktop.systemd1 Path=/org/freedesktop/systemd1 Interface=org.freedesktop.systemd1.Manager Member=StopUnit [ 340.373657] busctl[21800]: UniqueName=:1.13 [ 340.373657] busctl[21800]: MESSAGE "ss" { [ 340.373657] busctl[21800]: STRING "session-c1.scope"; [ 340.373657] busctl[21800]: STRING "fail"; [ 340.373657] busctl[21800]: }; [ 340.373551] systemd-machined[21797]: Sent message type=method_call sender=n/a destination=org.freedesktop.systemd1 path=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=StopUnit co> [ 340.380081] systemd[1]: mkosi-TEST-64-UDEV-STORAGE-long-sysfs-path-1.scope: 1 process added to scope's control group.
- Loading branch information