-
Notifications
You must be signed in to change notification settings - Fork 194
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
docs: Add debug.md #5068
Draft
jmarrero
wants to merge
1
commit into
coreos:main
Choose a base branch
from
jmarrero:debug-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
docs: Add debug.md #5068
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,60 @@ | ||
--- | ||
parent: Contributing | ||
nav_order: 1 | ||
--- | ||
|
||
# Debugging rpm-ostree | ||
{: .no_toc } | ||
|
||
1. TOC | ||
{:toc} | ||
|
||
|
||
## Setting verbose debug messages when using the CLI. | ||
|
||
The rpm-ostree and ostree code uses gtk's glib for the as a C library. An advantage to using glib is that to enable verbose debug messages we just need to set an environment variable: | ||
[G_MESSAGES_DEBUG=all](https://docs.gtk.org/glib/logging.html#debug-message-output). | ||
|
||
Additionally, part of rpm-ostree code is written in Rust to enable verbose logs on the Rust code the environment variable is: | ||
[RUST_LOG=debug](https://docs.rs/env_logger/latest/env_logger/). | ||
|
||
An example of how to set use the environment variables is: | ||
|
||
``` | ||
env G_MESSAGES_DEBUG=all RUST_LOG=debug rpm-ostree status | ||
``` | ||
|
||
Since ostree is called from rpm-ostree it will output ostree debug messages too. | ||
|
||
## Enabling verbose debug messages when not using the CLI. | ||
|
||
If you need output from rpm-ostreed.service, another client such as Zincati or ostree-finalize-staged.service | ||
you might need to override the environment variables for those services. | ||
|
||
A way to do this is using the `systemctl edit` command. | ||
|
||
For example: | ||
|
||
``` | ||
systemctl edit rpm-ostreed | ||
``` | ||
or | ||
``` | ||
systemctl edit zincati.service | ||
``` | ||
|
||
Then adding: | ||
``` | ||
[Service] | ||
Environment="G_MESSAGES_DEBUG=all" | ||
``` | ||
|
||
and restarting the service. | ||
|
||
After that a more verbose output should be seen in the journal: | ||
|
||
``` | ||
journalctl -b -u rpm-ostreed | ||
``` | ||
|
||
**Please Note** depending on what are you trying to debug you might need to override the environment for different services. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
maybe add
sudo
to the front of these command examples.otherwise looks great!