Bug 2383375
| Summary: | etckeeper-dnf5 slows down all dnf commands | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | vywunm0jfimu <vywunm0jfimu> |
| Component: | etckeeper | Assignee: | Thomas Moschny <thomas.moschny> |
| Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 42 | CC: | alberto, martin.bukatovic, thomas.moschny |
| Target Milestone: | --- | Keywords: | Improvement, Regression |
| Target Release: | --- | ||
| Hardware: | noarch | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | --- | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2026-06-08 17:59:54 UTC | 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
vywunm0jfimu
2025-07-25 12:51:34 UTC
Maybe this can be addressed by selecting a better dnf5 hook for pre-install as I note here: https://bugzilla.redhat.com/show_bug.cgi?id=2326283#c19? The culprit seems to the "pre_base_setup" callback in "etckeeper.actions". If the callback name is changed to "pre_transaction" then the unwanted
delay was no longer observed abd etckeeper commits changes below /etc before/after transaction (however with a strange subject line):
$ dnf remove -y fedora-repos-archive-42
...
Running transaction
[1/2] Prepare transaction 100% | 2.0 B/s | 1.0 B | 00m00s
[2/2] Removing fedora-repos-archive-0:42-1.noarch 100% [==================] | 0.0 B/s | 1.0 B | 00m00s
error: file /etc/yum.repos.d/fedora-updates-archive.repo: No such file or directory
[2/2] Removing fedora-repos-archive-0:42-1.noarch 100% | 0.0 B/s | 1.0 B | 00m06s
Complete!
$ git log -1
commit 834c6f20c4855e5fdc5eef4ec17828e609502f5e (HEAD -> f42)
Author: root <root@redacted>
Date: Sun Jul 27 16:33:41 2025 +0200
committing changes in /etc made by "/usr/bin/sh -c /usr/bin/etckeeper post-install | /usr/bin/sed -e 's/^/log.INFO=/'"
Package changes:
-0:fedora-repos-archive-42-1.noarch
$ dnf install -y fedora-repos-archive-42
...
Running transaction
1/3] Verify package files 100% | 333.0 B/s | 1.0 B | 00m00s
[2/3] Prepare transaction 100% | 2.0 B/s | 1.0 B | 00m00s
[3/3] Installing fedora-repos-archive-0:42-1.noarch 100% [==================] | 0.0 B/s | 1.2 KiB | 00m00s
[3/3] Installing fedora-repos-archive-0:42-1.noarch 100% | 167.0 B/s | 1.2 KiB | 00m08s
Complete!
$ git log -1
commit 287013724bb75c892c8f20a8b21e7605f4b91f50 (HEAD -> leo_f42, origin/leo_f42)
Author: root <root@redacted>
Date: Sun Jul 27 16:48:52 2025 +0200
committing changes in /etc made by "/usr/bin/sh -c /usr/bin/etckeeper post-install | /usr/bin/sed -e 's/^/log.INFO=/'"
Package changes:
+0:fedora-repos-archive-42-1.noarch
BTW: In the RPM spec /etc/dnf/libdnf5-plugins/actions.d/etckeeper.actions should be flagged as config file. The capture of the dnf command-line in "etckeeper/post-install.d/50vcs-commit" no longer works because the bash process
created by the "post_action" command is now the etckeeper parent process. Following diff contains a fix for this:
$ git diff 21d797d405fde157bed3231be6015768fdbf330b -- dnf/ etckeeper/
diff --git a/dnf/libdnf5-plugins/actions.d/etckeeper.actions b/dnf/libdnf5-plugins/actions.d/etckeeper.actions
index f654e216..c22cfadd 100644
--- a/dnf/libdnf5-plugins/actions.d/etckeeper.actions
+++ b/dnf/libdnf5-plugins/actions.d/etckeeper.actions
@@ -1,4 +1,4 @@
# to be placed in /etc/dnf/libdnf5-plugins/actions.d
# requires dnf5 5.2.11.0 or later
-pre_base_setup:::raise_error=1:/usr/bin/sh -c /usr/bin/etckeeper\ pre-install\ \|\ /usr/bin/sed\ -e\ 's/^/log.INFO=/'
-post_transaction::::/usr/bin/sh -c /usr/bin/etckeeper\ post-install\ \|\ /usr/bin/sed\ -e\ 's/^/log.INFO=/'
+pre_transaction:::raise_error=1:/usr/bin/sh -c /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=/'
diff --git a/etckeeper/post-install.d/50vcs-commit b/etckeeper/post-install.d/50vcs-commit
index 40cb12ae..b06efba3 100755
--- a/etckeeper/post-install.d/50vcs-commit
+++ b/etckeeper/post-install.d/50vcs-commit
@@ -10,8 +10,12 @@ ETCKEEPER_PID=$( ps --no-headers -o ppid "$$" 2>/dev/null | sed 's/^ *//' )
# Find the parent of etckeeper and get the command line of the process
if ! [ -z "${ETCKEEPER_PID}" ]; then
- ETCKEEPER_PPID=$( ps --no-headers -o ppid "${ETCKEEPER_PID}" | sed 's/^ *//' )
- ETCKEEPER_PARENT_COMMAND_LINE=$( ps --no-headers -o args "${ETCKEEPER_PPID}" )
+ if [ -n "$DNF_PID" ] ; then
+ ETCKEEPER_PPID=$DNF_PID
+ else
+ ETCKEEPER_PPID=$( ps --no-headers -o ppid "${ETCKEEPER_PID}" | sed 's/^ *//' )
+ fi
+ ETCKEEPER_PARENT_COMMAND_LINE=$( ps --no-headers -o args "${ETCKEEPER_PPID}" )
fi
get_changes () {
Test:
$ dnf install -y fedora-repos-archive-42
...
[1/1] Total 100% | 0.0 B/s | 0.0 B | 00m00s
Running transaction
[1/3] Verify package files 100% | 500.0 B/s | 1.0 B | 00m00s
[2/3] Prepare transaction 100% | 2.0 B/s | 1.0 B | 00m00s
[3/3] Installing fedora-repos-archive-0:42-1.noarch 100% | 167.0 B/s | 1.2 KiB | 00m08s
Complete!
$ git log -1
commit e05886377141ca11f15191ffc80bb381e0d6dd1a (HEAD -> f42)
Author: root <root@redacted>
Date: Mon Jul 28 13:33:32 2025 +0200
committing changes in /etc made by "dnf install -y fedora-repos-archive-42"
Package changes:
+0:fedora-repos-archive-42-1.noarch
To avoid commit subjects exceeding usual line length limits following statement may be inserted after "ETCKEEPER_PARENT_COMMAND_LINE=.."
[ ${#ETCKEEPER_PARENT_COMMAND_LINE} -le 75 ] || ETCKEEPER_PARENT_COMMAND_LINE="${ETCKEEPER_PARENT_COMMAND_LINE:0:72} .."
This message is a reminder that Fedora Linux 42 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 42 on 2026-05-13. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '42'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 42 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed. Fedora Linux 42 entered end-of-life (EOL) status on 2026-05-27. Fedora Linux 42 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed. |