All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dnf: remove log_lock.pid before exit
@ 2024-03-07  6:48 changqing.li
  2024-03-07  7:09 ` Patchtest results for " patchtest
  2024-03-07  8:13 ` [OE-core] " Alexander Kanavin
  0 siblings, 2 replies; 4+ messages in thread
From: changqing.li @ 2024-03-07  6:48 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@windriver.com>

dnf has a bug, refer [1], it causes that log_lock.pid may not removed
after dnf exit. And for native dnf, since we change the lock file path
to /, it will never be removed, and make the rootfs not clean,refer
[2][3].  This patch is a workaround to fix above issue.

[1] https://github.com/rpm-software-management/dnf/issues/1963
[2] https://git.openembedded.org/openembedded-core/commit/?id=742a1b71249f4da1c8d8e13e270b0eb6128a3f66
[3] https://github.com/rpm-software-management/dnf/blob/master/etc/tmpfiles.d/dnf.conf

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 ...n.py-remove-log_lock.pid-before-exit.patch | 41 +++++++++++++++++++
 meta/recipes-devtools/dnf/dnf_4.18.2.bb       |  3 +-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch

diff --git a/meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch b/meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch
new file mode 100644
index 0000000000..ae036cbbd6
--- /dev/null
+++ b/meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch
@@ -0,0 +1,41 @@
+From bdf17281385cf33ad59267fe75a9e427e6e2ffc4 Mon Sep 17 00:00:00 2001
+From: Changqing Li <changqing.li@windriver.com>
+Date: Thu, 7 Mar 2024 14:03:07 +0800
+Subject: [PATCH] main.py: remove log_lock.pid before exit
+
+dnf has a bug, refer [1], it causes that log_lock.pid may not removed
+after dnf exit. And for native dnf, since we change the lock file path
+to /, it will never be removed, and make the rootfs not clean,refer
+[2][3].  This patch is a workaround to fix above issue.
+
+[1] https://github.com/rpm-software-management/dnf/issues/1963
+[2] https://git.openembedded.org/openembedded-core/commit/?id=742a1b71249f4da1c8d8e13e270b0eb6128a3f66
+[3] https://github.com/rpm-software-management/dnf/blob/master/etc/tmpfiles.d/dnf.conf
+
+Upstream-Status: Submited [ report to https://github.com/rpm-software-management/dnf/issues/1963]
+
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+---
+ dnf/cli/main.py | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/dnf/cli/main.py b/dnf/cli/main.py
+index 2a7f92d54..2f672cff2 100644
+--- a/dnf/cli/main.py
++++ b/dnf/cli/main.py
+@@ -200,6 +200,12 @@ def user_main(args, exit_code=False):
+ 
+     errcode = main(args)
+     if exit_code:
++        for arg in args:
++            if arg.startswith("--installroot="):
++                root=arg.split("=")[1]
++                if os.path.exists(os.path.join(root, "log_lock.pid")):
++                    os.unlink(os.path.join(root, "log_lock.pid"))
++                break
+         sys.exit(errcode)
+     return errcode
+ 
+-- 
+2.25.1
+
diff --git a/meta/recipes-devtools/dnf/dnf_4.18.2.bb b/meta/recipes-devtools/dnf/dnf_4.18.2.bb
index dc0c18be5e..7770c9d7e0 100644
--- a/meta/recipes-devtools/dnf/dnf_4.18.2.bb
+++ b/meta/recipes-devtools/dnf/dnf_4.18.2.bb
@@ -17,7 +17,8 @@ SRC_URI = "git://github.com/rpm-software-management/dnf.git;branch=master;protoc
            file://0001-set-python-path-for-completion_helper.patch \
            "
 
-SRC_URI:append:class-native = "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 \
+                               file://0001-main.py-remove-log_lock.pid-before-exit.patch"
 
 SRCREV = "1c43d0999178d492381ad0b43917ffd9c74016f8"
 UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Patchtest results for [PATCH] dnf: remove log_lock.pid before exit
  2024-03-07  6:48 [PATCH] dnf: remove log_lock.pid before exit changqing.li
@ 2024-03-07  7:09 ` patchtest
  2024-03-07  8:13 ` [OE-core] " Alexander Kanavin
  1 sibling, 0 replies; 4+ messages in thread
From: patchtest @ 2024-03-07  7:09 UTC (permalink / raw)
  To: changqing.li; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2840 bytes --]

Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:

---
Testing patch /home/patchtest/share/mboxes/dnf-remove-log_lock.pid-before-exit.patch

FAIL: test Upstream-Status presence: Upstream-Status is in incorrect format (test_patch.TestPatch.test_upstream_status_presence_format)

PASS: pretest src uri left files (test_metadata.TestMetadata.pretest_src_uri_left_files)
PASS: test CVE check ignore (test_metadata.TestMetadata.test_cve_check_ignore)
PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test lic files chksum modified not mentioned (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test src uri left files (test_metadata.TestMetadata.test_src_uri_left_files)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
SKIP: test target mailing list: Series merged, no reason to check other mailing lists (test_mbox.TestMbox.test_target_mailing_list)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [PATCH] dnf: remove log_lock.pid before exit
  2024-03-07  6:48 [PATCH] dnf: remove log_lock.pid before exit changqing.li
  2024-03-07  7:09 ` Patchtest results for " patchtest
@ 2024-03-07  8:13 ` Alexander Kanavin
  2024-03-07  8:52   ` Changqing Li
  1 sibling, 1 reply; 4+ messages in thread
From: Alexander Kanavin @ 2024-03-07  8:13 UTC (permalink / raw)
  To: Changqing Li; +Cc: openembedded-core

Thanks, the patch is ok, but you need to actually open a dnf pull
request with the patch, and not just the ticket (also 'Submitted'
means that the patch was actually provided to upstream). It's okay if
upstream then rejects the patch. We'll at least try to convince them
:)

Alex

On Thu, 7 Mar 2024 at 07:49, Changqing Li
<changqing.li@eng.windriver.com> wrote:
>
> From: Changqing Li <changqing.li@windriver.com>
>
> dnf has a bug, refer [1], it causes that log_lock.pid may not removed
> after dnf exit. And for native dnf, since we change the lock file path
> to /, it will never be removed, and make the rootfs not clean,refer
> [2][3].  This patch is a workaround to fix above issue.
>
> [1] https://github.com/rpm-software-management/dnf/issues/1963
> [2] https://git.openembedded.org/openembedded-core/commit/?id=742a1b71249f4da1c8d8e13e270b0eb6128a3f66
> [3] https://github.com/rpm-software-management/dnf/blob/master/etc/tmpfiles.d/dnf.conf
>
> Signed-off-by: Changqing Li <changqing.li@windriver.com>
> ---
>  ...n.py-remove-log_lock.pid-before-exit.patch | 41 +++++++++++++++++++
>  meta/recipes-devtools/dnf/dnf_4.18.2.bb       |  3 +-
>  2 files changed, 43 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch
>
> diff --git a/meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch b/meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch
> new file mode 100644
> index 0000000000..ae036cbbd6
> --- /dev/null
> +++ b/meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch
> @@ -0,0 +1,41 @@
> +From bdf17281385cf33ad59267fe75a9e427e6e2ffc4 Mon Sep 17 00:00:00 2001
> +From: Changqing Li <changqing.li@windriver.com>
> +Date: Thu, 7 Mar 2024 14:03:07 +0800
> +Subject: [PATCH] main.py: remove log_lock.pid before exit
> +
> +dnf has a bug, refer [1], it causes that log_lock.pid may not removed
> +after dnf exit. And for native dnf, since we change the lock file path
> +to /, it will never be removed, and make the rootfs not clean,refer
> +[2][3].  This patch is a workaround to fix above issue.
> +
> +[1] https://github.com/rpm-software-management/dnf/issues/1963
> +[2] https://git.openembedded.org/openembedded-core/commit/?id=742a1b71249f4da1c8d8e13e270b0eb6128a3f66
> +[3] https://github.com/rpm-software-management/dnf/blob/master/etc/tmpfiles.d/dnf.conf
> +
> +Upstream-Status: Submited [ report to https://github.com/rpm-software-management/dnf/issues/1963]
> +
> +Signed-off-by: Changqing Li <changqing.li@windriver.com>
> +---
> + dnf/cli/main.py | 6 ++++++
> + 1 file changed, 6 insertions(+)
> +
> +diff --git a/dnf/cli/main.py b/dnf/cli/main.py
> +index 2a7f92d54..2f672cff2 100644
> +--- a/dnf/cli/main.py
> ++++ b/dnf/cli/main.py
> +@@ -200,6 +200,12 @@ def user_main(args, exit_code=False):
> +
> +     errcode = main(args)
> +     if exit_code:
> ++        for arg in args:
> ++            if arg.startswith("--installroot="):
> ++                root=arg.split("=")[1]
> ++                if os.path.exists(os.path.join(root, "log_lock.pid")):
> ++                    os.unlink(os.path.join(root, "log_lock.pid"))
> ++                break
> +         sys.exit(errcode)
> +     return errcode
> +
> +--
> +2.25.1
> +
> diff --git a/meta/recipes-devtools/dnf/dnf_4.18.2.bb b/meta/recipes-devtools/dnf/dnf_4.18.2.bb
> index dc0c18be5e..7770c9d7e0 100644
> --- a/meta/recipes-devtools/dnf/dnf_4.18.2.bb
> +++ b/meta/recipes-devtools/dnf/dnf_4.18.2.bb
> @@ -17,7 +17,8 @@ SRC_URI = "git://github.com/rpm-software-management/dnf.git;branch=master;protoc
>             file://0001-set-python-path-for-completion_helper.patch \
>             "
>
> -SRC_URI:append:class-native = "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 \
> +                               file://0001-main.py-remove-log_lock.pid-before-exit.patch"
>
>  SRCREV = "1c43d0999178d492381ad0b43917ffd9c74016f8"
>  UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
> --
> 2.25.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#196770): https://lists.openembedded.org/g/openembedded-core/message/196770
> Mute This Topic: https://lists.openembedded.org/mt/104782944/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [PATCH] dnf: remove log_lock.pid before exit
  2024-03-07  8:13 ` [OE-core] " Alexander Kanavin
@ 2024-03-07  8:52   ` Changqing Li
  0 siblings, 0 replies; 4+ messages in thread
From: Changqing Li @ 2024-03-07  8:52 UTC (permalink / raw)
  To: openembedded-core


On 3/7/24 16:14, Alexander Kanavin wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> Thanks, the patch is ok, but you need to actually open a dnf pull
> request with the patch, and not just the ticket (also 'Submitted'
> means that the patch was actually provided to upstream). It's okay if
> upstream then rejects the patch. We'll at least try to convince them
> :)
>
> Alex

ok, I will send an pull request and send a v2 with the pull request.

Thanks

Changqing

>
> On Thu, 7 Mar 2024 at 07:49, Changqing Li
> <changqing.li@eng.windriver.com> wrote:
>> From: Changqing Li <changqing.li@windriver.com>
>>
>> dnf has a bug, refer [1], it causes that log_lock.pid may not removed
>> after dnf exit. And for native dnf, since we change the lock file path
>> to /, it will never be removed, and make the rootfs not clean,refer
>> [2][3].  This patch is a workaround to fix above issue.
>>
>> [1] https://github.com/rpm-software-management/dnf/issues/1963
>> [2] https://git.openembedded.org/openembedded-core/commit/?id=742a1b71249f4da1c8d8e13e270b0eb6128a3f66
>> [3] https://github.com/rpm-software-management/dnf/blob/master/etc/tmpfiles.d/dnf.conf
>>
>> Signed-off-by: Changqing Li <changqing.li@windriver.com>
>> ---
>>   ...n.py-remove-log_lock.pid-before-exit.patch | 41 +++++++++++++++++++
>>   meta/recipes-devtools/dnf/dnf_4.18.2.bb       |  3 +-
>>   2 files changed, 43 insertions(+), 1 deletion(-)
>>   create mode 100644 meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch
>>
>> diff --git a/meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch b/meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch
>> new file mode 100644
>> index 0000000000..ae036cbbd6
>> --- /dev/null
>> +++ b/meta/recipes-devtools/dnf/dnf/0001-main.py-remove-log_lock.pid-before-exit.patch
>> @@ -0,0 +1,41 @@
>> +From bdf17281385cf33ad59267fe75a9e427e6e2ffc4 Mon Sep 17 00:00:00 2001
>> +From: Changqing Li <changqing.li@windriver.com>
>> +Date: Thu, 7 Mar 2024 14:03:07 +0800
>> +Subject: [PATCH] main.py: remove log_lock.pid before exit
>> +
>> +dnf has a bug, refer [1], it causes that log_lock.pid may not removed
>> +after dnf exit. And for native dnf, since we change the lock file path
>> +to /, it will never be removed, and make the rootfs not clean,refer
>> +[2][3].  This patch is a workaround to fix above issue.
>> +
>> +[1] https://github.com/rpm-software-management/dnf/issues/1963
>> +[2] https://git.openembedded.org/openembedded-core/commit/?id=742a1b71249f4da1c8d8e13e270b0eb6128a3f66
>> +[3] https://github.com/rpm-software-management/dnf/blob/master/etc/tmpfiles.d/dnf.conf
>> +
>> +Upstream-Status: Submited [ report to https://github.com/rpm-software-management/dnf/issues/1963]
>> +
>> +Signed-off-by: Changqing Li <changqing.li@windriver.com>
>> +---
>> + dnf/cli/main.py | 6 ++++++
>> + 1 file changed, 6 insertions(+)
>> +
>> +diff --git a/dnf/cli/main.py b/dnf/cli/main.py
>> +index 2a7f92d54..2f672cff2 100644
>> +--- a/dnf/cli/main.py
>> ++++ b/dnf/cli/main.py
>> +@@ -200,6 +200,12 @@ def user_main(args, exit_code=False):
>> +
>> +     errcode = main(args)
>> +     if exit_code:
>> ++        for arg in args:
>> ++            if arg.startswith("--installroot="):
>> ++                root=arg.split("=")[1]
>> ++                if os.path.exists(os.path.join(root, "log_lock.pid")):
>> ++                    os.unlink(os.path.join(root, "log_lock.pid"))
>> ++                break
>> +         sys.exit(errcode)
>> +     return errcode
>> +
>> +--
>> +2.25.1
>> +
>> diff --git a/meta/recipes-devtools/dnf/dnf_4.18.2.bb b/meta/recipes-devtools/dnf/dnf_4.18.2.bb
>> index dc0c18be5e..7770c9d7e0 100644
>> --- a/meta/recipes-devtools/dnf/dnf_4.18.2.bb
>> +++ b/meta/recipes-devtools/dnf/dnf_4.18.2.bb
>> @@ -17,7 +17,8 @@ SRC_URI = "git://github.com/rpm-software-management/dnf.git;branch=master;protoc
>>              file://0001-set-python-path-for-completion_helper.patch \
>>              "
>>
>> -SRC_URI:append:class-native = "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 \
>> +                               file://0001-main.py-remove-log_lock.pid-before-exit.patch"
>>
>>   SRCREV = "1c43d0999178d492381ad0b43917ffd9c74016f8"
>>   UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
>> --
>> 2.25.1
>>
>>
>>
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#196776): https://lists.openembedded.org/g/openembedded-core/message/196776
>> Mute This Topic: https://lists.openembedded.org/mt/104782944/3616873
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [changqing.li@eng.windriver.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-07  8:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-07  6:48 [PATCH] dnf: remove log_lock.pid before exit changqing.li
2024-03-07  7:09 ` Patchtest results for " patchtest
2024-03-07  8:13 ` [OE-core] " Alexander Kanavin
2024-03-07  8:52   ` Changqing Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.