From 7e5c2f5234635abab205558aaf86c8ad97e20e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BC=BA10307170?= Date: Thu, 19 Jun 2025 11:14:02 +0800 Subject: [PATCH] iscsi:fix the ConditionDirectoryNotEmpty parameter check path during the iscsi.service start --- ...nditionDirectoryNotEmpty-parameter-c.patch | 37 +++++++++++++++++++ iscsi-initiator-utils.spec | 6 ++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 1004-iscsi-fix-the-ConditionDirectoryNotEmpty-parameter-c.patch diff --git a/1004-iscsi-fix-the-ConditionDirectoryNotEmpty-parameter-c.patch b/1004-iscsi-fix-the-ConditionDirectoryNotEmpty-parameter-c.patch new file mode 100644 index 0000000..4afb77a --- /dev/null +++ b/1004-iscsi-fix-the-ConditionDirectoryNotEmpty-parameter-c.patch @@ -0,0 +1,37 @@ +From b2b97aea8e5a80875c299b41c6364cb065bb6abc Mon Sep 17 00:00:00 2001 +From: zhaoqiang +Date: Thu, 19 Jun 2025 10:46:15 +0800 +Subject: [PATCH] iscsi:fix the ConditionDirectoryNotEmpty parameter check path + during the iscsi.service start + +In the higher version of iscsi-initiator-utils-2.1.8, the storage node +information path has changed from /var/lib/iscsi/nodes directory to +/etc/iscsi/nodes directory. After merging the 0001-unit-file-tweaks.patch +patch, the iscsi service startup will check the ConditionDirectoryNotEmpty +parameter, however, in the higher version of iscsi-initiator-utils-2.1.8, +the ConditionDirectoryNotEmpty parameter value for /var/lib/iscsi/nodes +path will cause the iscsi service to fail to start, making it impossible to +automatically log into iscsi storage. + +Therefore, it is necessary to change the ConditionDirectoryNotEmpty parameter +value in the iscsi service to /etc/iscsi/nodes path. +--- + etc/systemd/iscsi.service.template | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/etc/systemd/iscsi.service.template b/etc/systemd/iscsi.service.template +index 08adff7..beaa4a3 100644 +--- a/etc/systemd/iscsi.service.template ++++ b/etc/systemd/iscsi.service.template +@@ -5,7 +5,7 @@ DefaultDependencies=no + Before=remote-fs-pre.target + After=network.target network-online.target iscsid.service iscsiuio.service systemd-remount-fs.service + Wants=remote-fs-pre.target +-ConditionDirectoryNotEmpty=/var/lib/iscsi/nodes ++ConditionDirectoryNotEmpty=/etc/iscsi/nodes + + [Service] + Type=oneshot +-- +2.31.1 + diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec index fda8e2a..b76e079 100644 --- a/iscsi-initiator-utils.spec +++ b/iscsi-initiator-utils.spec @@ -1,4 +1,4 @@ -%define anolis_release 3 +%define anolis_release 4 %global _hardened_build 1 %global __provides_exclude_from ^(%{python3_sitearch}/.*\\.so)$ @@ -32,6 +32,7 @@ Patch0016: 0016-add-some-service-in-system.patch Patch1001: 1001-add-ISCSI_VERSION_STR-define.patch Patch1002: 1002-fix-the-libiscsi-build-error.patch Patch1003: 1003-change-the-sbin-dir-to-usr-sbin.patch +Patch1004: 1004-iscsi-fix-the-ConditionDirectoryNotEmpty-parameter-c.patch BuildRequires: autoconf automake BuildRequires: flex bison doxygen kmod-devel libtool systemd-units @@ -254,6 +255,9 @@ systemctl --no-reload preset iscsi.service iscsi-starter.service &>/dev/null || %{abidir}/libiscsi.cpython-%{python3_version_nodots}-%{_arch}-linux-gnu.dump %changelog +* Thu Jun 19 2025 zhaoqiang - 2.1.8-4 +- iscsi:fix the ConditionDirectoryNotEmpty parameter check path during the iscsi.service start + * Tue Mar 12 2024 Bo Ren - 2.1.8-3 - Rebuild with python3.11 -- Gitee