]> git.ipfire.org Git - thirdparty/systemd.git/commit
shutdown: do not delay VM shutdown (#42396)
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Wed, 3 Jun 2026 14:10:20 +0000 (16:10 +0200)
committerGitHub <noreply@github.com>
Wed, 3 Jun 2026 14:10:20 +0000 (16:10 +0200)
commitbf3d2b03e9c1b2ada10608c89a82e2df782ce7e8
tree82ff3c6140258d8158e883a37a549ce19a05c655
parent787a0486129e9c70f01ce36a0cf2663846a35615
parentb811fa5b325061bf492b11332a9ce512f9b8d0c5
shutdown: do not delay VM shutdown (#42396)

Since this was introduced I constantly find myself waiting for VMs to
shut down at the end of a test. This not only happens with mkosi
integration tests, but with other VM-based tests like for example
autopkgtest. In this example, this dracut test suite runtime is tripled
due to the artificial delay:

```
[    5.813234] systemd-shutdown[1]: Syncing filesystems and block devices.
[    5.814635] systemd-shutdown[1]: Delaying shutdown for 9s, in order to reach minimum uptime of 15s.
[    8.816855] systemd-shutdown[1]: Delaying shutdown for 6s, in order to reach minimum uptime of 15s.
[   11.819747] systemd-shutdown[1]: Delaying shutdown for 3s, in order to reach minimum uptime of 15s.
[   14.822660] systemd-shutdown[1]: Delaying shutdown for 601ms, in order to reach minimum uptime of 15s.
[   15.427777] systemd-shutdown[1]: Powering off.
[   15.429681] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[   15.433620] ACPI: PM: Preparing to enter system sleep state S5
[   15.435148] reboot: Power down
TEST: root filesystem on a ext4 filesystem with systemd and extensions   [OK]
autopkgtest [19:39:12]: test 46-systemd-sysext: -----------------------]
autopkgtest [19:39:13]: test 46-systemd-sysext:  - - - - - - - - - - results - - - - - - - - - -
46-systemd-sysext    PASS
```

Contrary to what the comment claimed, the scrollback of a VM is _not_
cleared, EDK2 just prints many pages, and one can just scroll up (a
lot).

Do not delay by default on VMs. Move the check so that in both
containers and VMs users can override and force a delay with the env
var.

Follow-up for 0874eea302d0ba2d436dcce0b992cdc957190ff4