New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
status: Print systemd or ostree staged failure msg #1609
Conversation
Sample output: ``` $ rpm-ostree status State: idle Warning: failed to finalize previous deployment check `journalctl -b -1 -u ostree-finalize-staged.service` AutomaticUpdates: disabled ... ``` (Though open to tweaking it). I also played with directly invoking `journalctl` for the user, but that can get really spammy with e.g. `os-prober` output and such. I wrote this in Rust using journal API wrappers because I also plan to implement the `history` command in Rust and will also enhance that new `journal` module there for that. Requires: ostreedev/ostree#1750 Requires: codyps/rust-systemd#54 (Though I've pointed the manifest at my branch for now for CI). Closes: coreos#1567
Nuke systemd source files for the same reasons as libcurl (see coreos#1554). Also noticed that libz-sys was doing this, though it's not new to this patch. For reference, see: coreos#1554
Try to tease out a bit more info from the journal by looking at the systemd message when the service transitions to the dead state or even looking at the OSTree output itself. Example outputs: ``` [root@f28-ros ~]# rpm-ostree status State: idle Warning: failed to finalize previous deployment error: opendir(ostree/deploy/fedora-atomic/deploy/887c95887a3047a60372016a0d84536530755b60df3cca33c819f7606e220adf.0): No such file or directory check `journalctl -b -1 -u ostree-finalize-staged.service` AutomaticUpdates: disabled ... ``` ``` [root@f28-ros ~]# rpm-ostree status State: idle Warning: failed to finalize previous deployment ostree-finalize-staged.service: Failed with result 'timeout'. check `journalctl -b -1 -u ostree-finalize-staged.service` AutomaticUpdates: disabled ... ```
rust/src/lib.rs
Outdated
JournalStagingFailure::SystemdMsg(m) | JournalStagingFailure::OstreeErrorMsg(m) => { | ||
let cbuf = CUtf8Buf::from(m); | ||
unsafe { | ||
ptr::copy_nonoverlapping(cbuf.as_ptr(), buf, bufsize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is basically memcpy
.
Looks pretty elegant overall. I find myself wondering though if it's really worth the overhead of maintaining a nice API for this versus just moving the |
I was initially against this since it's odd to split the printing out across multiple places, though you can't argue with the difference in simplicity. Done in ⬆️! Might as well stick with the simpler approach for now until there's a compelling reason to make it worth being more complex. |
I added another |
Part of #1601 (because that last fixup is actually needed to pass tests). |
Follow-up from #1601.
Try to tease out a bit more info from the journal by looking at the
systemd message when the service transitions to the dead state or even
looking at the OSTree output itself.
Example outputs: