Skip to content
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

Silence systemctl messages #74

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Silence systemctl messages #74

merged 1 commit into from
Nov 19, 2024

Conversation

ntrrgc
Copy link
Member

@ntrrgc ntrrgc commented Nov 11, 2024

systemctl status can be noisy if the log has been rotated, showing this message:

Warning: The unit file, source configuration file or drop-ins of
podman.socket changed on disk. Run 'systemctl --user daemon-reload'
to reload units.

This can be especially problematic in --quiet mode. This patch fixes that by redirecting stderr of the systemctl call used to get the running state of podman to /dev/null.

Copy link
Member

@dpino dpino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you would like to redirect both stdout and stderr, it can also be written as:

systemctl status --user podman.socket &>/dev/null

@ntrrgc
Copy link
Member Author

ntrrgc commented Nov 13, 2024

Sure, why not, can do both, will update.

systemctl status can be noisy if the log has been rotated, showing this
message:

> Warning: The unit file, source configuration file or drop-ins of
> podman.socket changed on disk. Run 'systemctl --user daemon-reload'
> to reload units.

This can be especially problematic in --quiet mode. This patch fixes
that by redirecting stderr of the systemctl call used to get the running
state of podman to /dev/null.
Copy link
Member

@dpino dpino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good to me. I assumme that since originally the stdout output of the command was ignored, it makes sense stderr is ignored too.

@TingPing TingPing enabled auto-merge (rebase) November 14, 2024 14:38
@TingPing TingPing merged commit 3c826da into Igalia:main Nov 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants