!59 [sync] PR-58: nfs-blkmaped: Fix the error status when nfs_blkmapd stops

From: @openeuler-sync-bot 
Reviewed-by: @liuzhiqiang26 
Signed-off-by: @liuzhiqiang26
This commit is contained in:
openeuler-ci-bot 2022-09-15 12:36:50 +00:00 committed by Gitee
commit d4ae7b1218
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.1
Release: 6
Release: 7
Epoch: 1
Summary: The Linux NFS userland utility package
License: MIT and GPLv2 and GPLv2+ and BSD
@ -16,6 +16,7 @@ Patch0: 0000-systemd-idmapd-require-rpc-pipefs.patch
Patch1: 0001-correct-the-statd-path-in-man.patch
Patch2: 0002-fix-coredump-in-bl_add_disk.patch
Patch3: 0003-nfs-utils-set-use-gss-proxy-1-to-enable-gss-proxy-by.patch
Patch4: 0004-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
@ -224,6 +225,9 @@ fi
%{_mandir}/*/*
%changelog
* Tue Sep 6 2022 zhanchengbin <zhanchengbin@huawei.com> - 1:2.5.1-7
- nfs-blkmaped: Fix the error status when nfs_blkmapd stops
* Fri Jul 1 2022 liwenchong <liwenchong@kylinos.cn> - 1:2.5.1-6
- set use-gss-proxy to true in nfs.conf to be consistent with the
description of 0003-nfs-utils-set-use-gss-proxy-1-to-enable-gss-proxy-by.patch