From df9e4c49b8982ce0eeb48b1875d52f484668cb7f Mon Sep 17 00:00:00 2001 From: zhanchengbin Date: Tue, 6 Sep 2022 10:01:06 +0800 Subject: [PATCH] nfs-blkmapd:Fix the error status when nfs-blkmapd stops Signed-off-by: zhanchengbin update 0006-nfs-blkmaped-Fix-the-error-status-when-nfs_blkmapd-s.patch. (cherry picked from commit aa8445463089084608e2525443f3057595171694) --- ...-the-error-status-when-nfs_blkmapd-s.patch | 35 +++++++++++++++++++ nfs-utils.spec | 6 +++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0006-nfs-blkmaped-Fix-the-error-status-when-nfs_blkmapd-s.patch diff --git a/0006-nfs-blkmaped-Fix-the-error-status-when-nfs_blkmapd-s.patch b/0006-nfs-blkmaped-Fix-the-error-status-when-nfs_blkmapd-s.patch new file mode 100644 index 0000000..30e9b7c --- /dev/null +++ b/0006-nfs-blkmaped-Fix-the-error-status-when-nfs_blkmapd-s.patch @@ -0,0 +1,35 @@ +From 576d3569c025e829e4ce432103532fcf63808d39 Mon Sep 17 00:00:00 2001 +From: zhanchengbin +Date: Tue, 6 Sep 2022 09:49:30 +0800 +Subject: [PATCH] nfs-blkmaped: Fix the error status when nfs_blkmapd stops + +The systemctl stop nfs-blkmap.service will sends the SIGTERM signal +to the nfs-blkmap.service first.If the process fails to be stopped, +it sends the SIGKILL signal again to kill the process. +However, exit(1) is executed in the SIGTERM processing function of +nfs-blkmap.service. As a result, systemd receives an error message +indicating that nfs-blkmap.service failed. +"Active: failed" is displayed when the systemctl status +nfs-blkmap.service command is executed. + +Signed-off-by: zhanchengbin +--- + utils/blkmapd/device-discovery.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c +index 77ebe73..8ca548c 100644 +--- a/utils/blkmapd/device-discovery.c ++++ b/utils/blkmapd/device-discovery.c +@@ -462,7 +462,7 @@ static void sig_die(int signal) + unlink(PID_FILE); + } + BL_LOG_ERR("exit on signal(%d)\n", signal); +- exit(1); ++ exit(0); + } + static void usage(void) + { +-- +1.8.3.1 + diff --git a/nfs-utils.spec b/nfs-utils.spec index 97a5aab..48a6a20 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -4,7 +4,7 @@ Name: nfs-utils Version: 2.5.4 -Release: 7 +Release: 8 Epoch: 2 Summary: The Linux NFS userland utility package License: MIT and GPLv2 and GPLv2+ and BSD @@ -18,6 +18,7 @@ Patch2: 0002-nfs-utils-set-use-gss-proxy-1-to-enable-gss-proxy-by.patch Patch3: 0003-idmapd-Fix-error-status-when-nfs-idmapd-exits.patch Patch4: 0004-fix-coredump-in-bl_add_disk.patch Patch5: 0005-Fix-format-overflow-warning.patch +Patch6: 0006-nfs-blkmaped-Fix-the-error-status-when-nfs_blkmapd-s.patch BuildRequires: libevent-devel,libcap-devel, libtirpc-devel libblkid-devel BuildRequires: krb5-libs >= 1.4 autoconf >= 2.57 openldap-devel >= 2.2 BuildRequires: automake, libtool, gcc, device-mapper-devel @@ -228,6 +229,9 @@ fi %{_mandir}/*/* %changelog +* Tue Sep 6 2022 zhanchengbin - 2:2.5.4-8 +- nfs-blkmapd: Fix the error status when nfs-blkmapd stops + * Thu Aug 11 2022 xueyamao - 2:2.5.4-7 - systemd: Fix format-overflow warning. -- Gitee