Skip to content

Commit 0b60629

Browse files
cgwaltersdustymabe
authored andcommitted
qemu: Ensure virtio journal streaming is killed on shutdown
In ostreedev/ostree#3513 i'm trying to ensure that all the ostree mounts are cleaned up. It turned out that it was *this* unit keeping `/var` open because the `journalctl` binary doesn't know to stop tracking the `/var/log/journal` files when the daemon has flushed. (We could obviously fix systemd to handle this) But anyways the main reason this exists is to forward logs from startup and especially entering emergency.target. While it's useful to get logs from shutdown, there are other ways to do that. This makes `var.mount` reliably unmounted for me.
1 parent bba409a commit 0b60629

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mantle/platform/qemu.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,12 @@ func (builder *QemuBuilder) VirtioJournal(config *conf.Conf, queryArguments stri
16561656
# won't be added to this unit, which would cause it to get
16571657
# taken down when isolating to emergency.target
16581658
DefaultDependencies=no
1659-
After=systemd.journal.service
1659+
After=systemd-journald.socket
1660+
# Do however ensure we get killed before /var is going to be
1661+
# unmounted, otherwise we keep it open.
1662+
After=local-fs.target
1663+
# Do get killed on shutdown
1664+
Conflicts=shutdown.target
16601665
# After systemd-journal-flush because otherwise the journalctl -f
16611666
# below will stop when the journal is flushed. Not sure if this is
16621667
# a bug or intended behavior.

0 commit comments

Comments
 (0)