!275 [sync] PR-274: rename patches name and use patch from upstream

From: @openeuler-sync-bot 
Reviewed-by: @overweight 
Signed-off-by: @overweight
This commit is contained in:
openeuler-ci-bot 2022-04-19 01:32:52 +00:00 committed by Gitee
commit 4f06a29651
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
30 changed files with 76 additions and 82 deletions

View File

@ -1,53 +0,0 @@
From 07e13151c566588b5f679e2576d3dfc2125c6e7c Mon Sep 17 00:00:00 2001
From: huangkaibin <huangkaibin@huawei.com>
Date: Sun, 22 Apr 2018 18:49:19 +0800
Subject: [PATCH] systemd-core: nop_job of a unit must also be coldpluged
after deserization.
When a unit is not in-active, and systemctl try-restart is executed for
this unit,
systemd will do nothing for it and just accept it as a nop_job for the
unit.
When then nop-job is still in the running queue, then daemon-reload is
performed, this nop job
will be dropped from the unit since it is not coldpluged in the
unit_coldplug function.
After then, the systemctl try-restart command will hang forever since no
JOB_DONE dbus signal will be sent
to it from systemd.
This patch fix this problem by do coldplug for the nop_job in
unit_coldplug function.
---
src/core/unit.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/core/unit.c b/src/core/unit.c
index 0a2f3c8..b9bd102 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -3601,11 +3601,17 @@ int unit_coldplug(Unit *u) {
r = q;
}
- uj = u->job ?: u->nop_job;
- if (uj) {
- q = job_coldplug(uj);
- if (q < 0 && r >= 0)
- r = q;
+ if (u->job || u->nop_job) {
+ if (u->job) {
+ q = job_coldplug(u->job);
+ if (q < 0 && r >= 0)
+ r = q;
+ }
+ if (u->nop_job) {
+ q = job_coldplug(u->nop_job);
+ if (q < 0 && r >= 0)
+ r = q;
+ }
}
return r;
--
2.27.0

View File

@ -0,0 +1,44 @@
From 7dbd330c7ef28852db0fb044503ed6f072477d50 Mon Sep 17 00:00:00 2001
From: Geass-LL <shenxiaogll@163.com>
Date: Fri, 2 Apr 2021 11:27:59 +0800
Subject: [PATCH] unit: coldplug both job and nop_job if possible
Sometimes, both job and nop_job are deserialized. In this case,
if we only cold plug the job, the nop_job will also stuck in the
job list.
---
src/core/unit.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/core/unit.c b/src/core/unit.c
index 7c39e4d0f8..2f7f022ef3 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -3588,7 +3588,6 @@ int unit_add_blockdev_dependency(Unit *u, const char *what, UnitDependencyMask m
int unit_coldplug(Unit *u) {
int r = 0, q;
char **i;
- Job *uj;
assert(u);
@@ -3611,9 +3610,13 @@ int unit_coldplug(Unit *u) {
r = q;
}
- uj = u->job ?: u->nop_job;
- if (uj) {
- q = job_coldplug(uj);
+ if (u->job) {
+ q = job_coldplug(u->job);
+ if (q < 0 && r >= 0)
+ r = q;
+ }
+ if (u->nop_job) {
+ q = job_coldplug(u->nop_job);
if (q < 0 && r >= 0)
r = q;
}
--
2.27.0

View File

@ -20,7 +20,7 @@
Name: systemd
Url: https://www.freedesktop.org/wiki/Software/systemd
Version: 249
Release: 25
Release: 26
License: MIT and LGPLv2+ and GPLv2+
Summary: System and Service Manager
@ -46,34 +46,33 @@ Source105: rule_generator.functions
Source106: write_net_rules
Source107: detect_virt
Patch0001: 0001-update-rtc-with-system-clock-when-shutdown.patch
Patch0002: 0002-udev-add-actions-while-rename-netif-failed.patch
Patch0003: 0003-fix-two-VF-virtual-machines-have-same-mac-address.patch
Patch0004: 0004-logind-set-RemoveIPC-to-false-by-default.patch
Patch0005: 0005-rules-add-rule-for-naming-Dell-iDRAC-USB-Virtual-NIC.patch
Patch0006: 0006-unit-don-t-add-Requires-for-tmp.mount.patch
Patch0007: 0007-rules-add-elevator-kernel-command-line-parameter.patch
Patch0008: 0008-rules-add-the-rule-that-adds-elevator-kernel-command.patch
Patch0009: 0009-units-add-Install-section-to-tmp.mount.patch
Patch0010: 0010-Make-systemd-udevd.service-start-after-systemd-remou.patch
Patch0011: 0011-udev-virsh-shutdown-vm.patch
Patch0012: 0012-sd-bus-properly-initialize-containers.patch
Patch0013: 0013-Revert-core-one-step-back-again-for-nspawn-we-actual.patch
Patch0014: 0014-journal-don-t-enable-systemd-journald-audit.socket-b.patch
Patch0015: 0015-systemd-change-time-log-level.patch
Patch0016: 0016-fix-capsh-drop-but-ping-success.patch
Patch0017: 0017-resolved-create-etc-resolv.conf-symlink-at-runtime.patch
Patch0018: 0018-nop_job-of-a-unit-must-also-be-coldpluged-after-deserization.patch
Patch0019: 0019-pid1-bump-DefaultTasksMax-to-80-of-the-kernel-pid.ma.patch
Patch0020: 0020-fix-journal-file-descriptors-leak-problems.patch
Patch0021: 0021-activation-service-must-be-restarted-when-reactivated.patch
Patch0022: 0022-systemd-core-fix-problem-of-dbus-service-can-not-be-started.patch
Patch0023: 0023-delay-to-restart-when-a-service-can-not-be-auto-restarted.patch
Patch0024: 0024-disable-initialize_clock.patch
Patch0025: 0025-systemd-solve-that-rsyslog-reads-journal-s-object-of.patch
Patch0026: 0026-check-whether-command_prev-is-null-before-assigning-.patch
Patch0027: 0027-print-the-real-reason-for-link-update.patch
Patch0028: 0028-core-skip-change-device-to-dead-in-manager_catchup-d.patch
Patch0001: update-rtc-with-system-clock-when-shutdown.patch
Patch0002: udev-add-actions-while-rename-netif-failed.patch
Patch0003: fix-two-VF-virtual-machines-have-same-mac-address.patch
Patch0004: logind-set-RemoveIPC-to-false-by-default.patch
Patch0005: rules-add-rule-for-naming-Dell-iDRAC-USB-Virtual-NIC.patch
Patch0006: unit-don-t-add-Requires-for-tmp.mount.patch
Patch0007: rules-add-elevator-kernel-command-line-parameter.patch
Patch0008: rules-add-the-rule-that-adds-elevator-kernel-command.patch
Patch0009: units-add-Install-section-to-tmp.mount.patch
Patch0010: Make-systemd-udevd.service-start-after-systemd-remou.patch
Patch0011: udev-virsh-shutdown-vm.patch
Patch0012: sd-bus-properly-initialize-containers.patch
Patch0013: Revert-core-one-step-back-again-for-nspawn-we-actual.patch
Patch0014: journal-don-t-enable-systemd-journald-audit.socket-b.patch
Patch0015: systemd-change-time-log-level.patch
Patch0016: fix-capsh-drop-but-ping-success.patch
Patch0017: resolved-create-etc-resolv.conf-symlink-at-runtime.patch
Patch0018: pid1-bump-DefaultTasksMax-to-80-of-the-kernel-pid.ma.patch
Patch0019: fix-journal-file-descriptors-leak-problems.patch
Patch0020: activation-service-must-be-restarted-when-reactivated.patch
Patch0021: systemd-core-fix-problem-of-dbus-service-can-not-be-started.patch
Patch0022: delay-to-restart-when-a-service-can-not-be-auto-restarted.patch
Patch0023: disable-initialize_clock.patch
Patch0024: systemd-solve-that-rsyslog-reads-journal-s-object-of.patch
Patch0025: check-whether-command_prev-is-null-before-assigning-.patch
Patch0026: print-the-real-reason-for-link-update.patch
Patch0027: core-skip-change-device-to-dead-in-manager_catchup-d.patch
#backport
Patch6000: backport-core-fix-free-undefined-pointer-when-strdup-failed-i.patch
@ -103,6 +102,7 @@ Patch6023: backport-core-fix-SIGABRT-on-empty-exec-command-argv.patch
Patch6024: backport-core-service-also-check-path-in-exec-commands.patch
Patch6025: backport-Add-meson-option-to-disable-urlify.patch
Patch6026: backport-logind.conf-Fix-name-of-option-RuntimeDirectoryInode.patch
Patch6027: backport-unit-coldplug-both-job-and-nop_job-if-possible.patch
BuildRequires: gcc, gcc-c++
BuildRequires: libcap-devel, libmount-devel, pam-devel, libselinux-devel
@ -1505,6 +1505,9 @@ fi
%{_libdir}/security/pam_systemd.so
%changelog
* Mon Apr 18 2022 xujing <xujing99@huawei.com> - 249-26
- rename patches name and use patch from upstream
* Tue Apr 12 2022 xujing <xujing99@huawei.com> - 249-25
- core: skip change device to dead in manager_catchup during booting