Skip to contentSkip to conversation

dnf: only write the log lock to root for native dnf

PATCH In review [email protected] 3 participants 5 messages Jun 30, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dnf: only write the log lock to root for native dnf

From: Changqing Li <[email protected]>

From commit 742a1b7124, log_lock.pid is writen to root, but following file is not changed, which will make it never deleted, and an unexpected file exist in root dir after boot target.

$ tail  -n 1 etc/tmpfiles.d/dnf.conf
r /var/log/log_lock.pid

Besides, root dir may be read-only, so it is better still keep the log_lock.pid under /var/log, only write the log lock to root for native dnf for fixing issue mentioned in 742a1b7124

---
 meta/recipes-devtools/dnf/dnf_4.14.0.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/dnf/dnf_4.14.0.bb +2 -1
index 62df8c4ace..95007c9c4b 100644
@@ -15,9 +15,10 @@ SRC_URI = "git://github.com/rpm-software-management/dnf.git;branch=master;protoc
            file://0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \
            file://0030-Run-python-scripts-using-env.patch \
            file://0001-set-python-path-for-completion_helper.patch \
-           file://0001-dnf-write-the-log-lock-to-root.patch \
            "
 
+SRC_URI:append:class-native = "file://0001-dnf-write-the-log-lock-to-root.patch"
+
 SRCREV = "e50875b3f5790f70720bdb670e1dd2bf4d828744"
 UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
 
Signature · 1 line
2.35.5
#1 lore raw

PATCH 2/2 rootfs-postcommands.bbclass: add post func remove_unused_dnf_log_lock

From: Changqing Li <[email protected]>

Remove log_lock.pid which maybe created during do_rootfs. In commit [dnf: only write the log lock to root for native dnf], native dnf changed to write log lock to root, and target dnf still use /var/log, so log_lock.pid need to be removed post do_rootfs.

---
 meta/classes-recipe/rootfs-postcommands.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)
meta/classes-recipe/rootfs-postcommands.bbclass +7 -0
index 690fa976aa..7538c8b0b5 100644
@@ -49,6 +49,8 @@ ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;'
 
 ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs_qa_check; overlayfs_postprocess;", "", d)}'
 
+ROOTFS_POSTPROCESS_COMMAND += 'remove_unused_dnf_log_lock;'
+
 inherit image-artifact-names
 
 # Sort the user and group entries in /etc by ID in order to make the content
@@ -276,6 +278,11 @@ empty_var_volatile () {
 	fi
 }
 
+remove_unused_dnf_log_lock() {
+	if [ -e ${IMAGE_ROOTFS}/log_lock.pid ]; then
+		rm -rf ${IMAGE_ROOTFS}/log_lock.pid
+	fi
+}
 # Turn any symbolic /sbin/init link into a file
 remove_init_link () {
 	if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then
Signature · 1 line
2.35.5
#2 lore raw

Re: [OE-core] [mickledore][PATCH 2/2] rootfs-postcommands.bbclass: add post func remove_unused_dnf_log_lock

Is this also a problem in master, or is it mickledore specific?

Steve

Quoted 50 lines · Changqing Li

From: Changqing Li <[email protected]>

Remove log_lock.pid which maybe created during do_rootfs. In commit [dnf: only write the log lock to root for native dnf], native dnf changed to write log lock to root, and target dnf still use /var/log, so log_lock.pid need to be removed post do_rootfs.

---
 meta/classes-recipe/rootfs-postcommands.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)
meta/classes-recipe/rootfs-postcommands.bbclass +7 -1
index 690fa976aa..7538c8b0b5 100644
@@ -49,6 +49,8 @@ ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;'
 
 ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs_qa_check; overlayfs_postprocess;", "", d)}'
 
+ROOTFS_POSTPROCESS_COMMAND += 'remove_unused_dnf_log_lock;'
+
 inherit image-artifact-names
 
 # Sort the user and group entries in /etc by ID in order to make the content
@@ -276,6 +278,11 @@ empty_var_volatile () {
        fi
 }
 
+remove_unused_dnf_log_lock() {
+       if [ -e ${IMAGE_ROOTFS}/log_lock.pid ]; then
+               rm -rf ${IMAGE_ROOTFS}/log_lock.pid
+       fi
+}
 # Turn any symbolic /sbin/init link into a file
 remove_init_link () {
        if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then
--

2.35.5

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183686): https://lists.openembedded.org/g/openembedded-core/message/183686
Mute This Topic: https://lists.openembedded.org/mt/99869175/3620601
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

Re: [OE-core] [mickledore][PATCH 2/2] rootfs-postcommands.bbclass: add post func remove_unused_dnf_log_lock

Quoted 1 line · Steve Sakoman

Is this also a problem in master, or is it mickledore specific?

The same patches have been proposed for master with an "instant" backport requested. I really don't like this model of development as I have my doubts about how extensively they've been tested in one or the other.

I'm also not convinced the patches explain the issue properly or why things should be fixed as proposed. I think at the very least the commit messages need to better explain the issues.

Cheers,

Richard

#4 lore raw

Re: [OE-core] [mickledore][PATCH 2/2] rootfs-postcommands.bbclass: add post func remove_unused_dnf_log_lock

Quoted 8 lines · Richard Purdie
Quoted 1 line · Steve Sakoman

Is this also a problem in master, or is it mickledore specific?

The same patches have been proposed for master with an "instant" backport requested. I really don't like this model of development as I have my doubts about how extensively they've been tested in one or the other.

I typically don't do "instant" backports. If a patch is proposed for both master and a stable branch I wait till it is accepted into master. Then I give it a week or two before backporting to see if any issues develop in master -- if I remember in the midst of all the other patch wrangling for multiple stable branches!

I much prefer that people submit to master first, then when it is accepted send a backport patch for the appropriate stable branches. Sending all the branches at once just increases the risk that the backports get forgotten!

Steve

Quoted 7 lines

I'm also not convinced the patches explain the issue properly or why things should be fixed as proposed. I think at the very least the commit messages need to better explain the issues.

Cheers,

Richard