Bug 2383751
| Summary: | etckeeper-dnf5 doesn't stop transaction when /etc is not clean | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Martin B. <martin.bukatovic> |
| Component: | etckeeper | Assignee: | Thomas Moschny <thomas.moschny> |
| Status: | ASSIGNED --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 42 | CC: | alberto, thomas.moschny |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | --- | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Martin B.
2025-07-27 12:34:42 UTC
Let's ask dnf5 developers first before we decide how to handle this properly. I initiated the discussion upstream: https://github.com/rpm-software-management/dnf5/discussions/2366 Thinking about it again, errors are swallowed not by the fact that we add `log.INFO=` per se, but doing it in a pipe.
Therefore, adding "set -o pipefail" should help.
The proposal for /etc/dnf/libdnf5-plugins/actions.d/etckeeper.actions would therefore be:
# to be placed in /etc/dnf/libdnf5-plugins/actions.d
# requires dnf5 5.2.11.0 or later
pre_transaction:::raise_error=1:/usr/bin/sh -c set\ -o\ pipefail\;\ /usr/bin/etckeeper\ pre-install\ \|\ /usr/bin/sed\ -e\ 's/^/log.INFO=/'
post_transaction::::/usr/bin/sh -c DNF_PID=${pid}\ /usr/bin/etckeeper\ post-install\ \|\ /usr/bin/sed\ -e\ 's/^/log.INFO=/'
(also taking into account changes proposed in bug 2387561 and bug 2383375)
Or, after looking at https://dnf5.readthedocs.io/en/latest/dnf5_workflow.html, the goal_resolved hook should be even better. |