!54 nfs-blkmaped: Fix the error status when nfs_blkmapd stops

From: @hifi521 
Reviewed-by: @liuzhiqiang26 
Signed-off-by: @liuzhiqiang26
This commit is contained in:
openeuler-ci-bot 2022-09-06 06:10:56 +00:00 committed by Gitee
commit 20000f10da
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From 576d3569c025e829e4ce432103532fcf63808d39 Mon Sep 17 00:00:00 2001
From: zhanchengbin <zhanchengbin1@huawei.com>
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 <zhanchengbin1@huawei.com>
---
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

View File

@ -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 <zhanchengbin1@huawei.com> - 2:2.5.4-8
- nfs-blkmapd: Fix the error status when nfs-blkmapd stops
* Thu Aug 11 2022 xueyamao <xueyamao@ktlinos.cn> - 2:2.5.4-7
- systemd: Fix format-overflow warning.