This repository has been archived by the owner on Aug 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ignition-virtio-dump-journal.service
Debugging failures in the initrd is annoying; this code looks for a virtio-serial port named `com.coreos.ignition.journal`, and runs as part of `emergency.target`. I plan to change mantle to set up this port by default, so if something fails in the initramfs we'll at least reliably get the journal in a sane parsable format. This is a special targeted subset of coreos/ignition#585
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
dracut/99emergency-timeout/ignition-virtio-dump-journal.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=Ignition (virtio dump) | ||
Documentation=https://github.com/coreos/ignition | ||
ConditionPathExists=/etc/initrd-release | ||
DefaultDependencies=false | ||
ConditionVirtualization=|kvm | ||
ConditionVirtualization=|qemu | ||
After=basic.target | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
EnvironmentFile=/run/ignition.env | ||
ExecStart=/usr/bin/ignition-virtio-dump-journal | ||
|
11 changes: 11 additions & 0 deletions
11
dracut/99emergency-timeout/ignition-virtio-dump-journal.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
port=/dev/virtio-ports/com.coreos.ignition.journal | ||
if [ -e "${port}" ]; then | ||
journalctl -o json > "${port}" | ||
# And this signals end of stream | ||
echo '{}' > "${port}" | ||
else | ||
echo "Didn't find virtio port ${port}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters