diff --git a/test/units/testsuite-04.bsod.sh b/test/units/testsuite-04.bsod.sh index 30f0cb0bd48..36092fe821d 100755 --- a/test/units/testsuite-04.bsod.sh +++ b/test/units/testsuite-04.bsod.sh @@ -17,8 +17,22 @@ at_exit() { fi if mountpoint -q /var/log/journal; then + # In order to preserve the journal from the just run test we need to do a little dance, as + # --relinquish-var is not a "true" opposite of --flush, meaning that it won't move the existing + # journal(s) from /var/log/ to /run/log/. To do that, let's rotate the journal first, so all + # important bits are in the archived journal(s)... + journalctl --rotate + # ...then instruct sd-journald to write further entries to the runtime journal... journalctl --relinquish-var + # ...make sure there are no outstanding writes to the persistent journal that might block us from + # unmounting the tmpfs... + journalctl --sync + # ...move the archived journals to the runtime storage... + mv -v "/var/log/journal/$(