e3c68b
From fe9159ee42f0f67b01e6a495df8105ea0f66738d Mon Sep 17 00:00:00 2001
e3c68b
From: Mohammed Rafi KC <rkavunga@redhat.com>
e3c68b
Date: Thu, 30 May 2019 23:48:05 +0530
e3c68b
Subject: [PATCH 183/192] glusterd/svc: Stop stale process using the
e3c68b
 glusterd_proc_stop
e3c68b
e3c68b
While restarting a glusterd process, when we have a stale pid
e3c68b
we were doing a simple kill. Instead we can use glusterd_proc_stop
e3c68b
Because it has more logging plus force kill in case if there is
e3c68b
any problem with kill signal handling.
e3c68b
e3c68b
Upstream patch: https://review.gluster.org/#/c/glusterfs/+/22791/
e3c68b
e3c68b
>Change-Id: I4a2dadc210a7a65762dd714e809899510622b7ec
e3c68b
>updates: bz#1710054
e3c68b
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
e3c68b
e3c68b
Change-Id: I3327528d8ebf90bbb2221265a0cf059c9359f141
e3c68b
BUG: 1720248
e3c68b
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
e3c68b
Reviewed-on: https://code.engineering.redhat.com/gerrit/172290
e3c68b
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
e3c68b
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e3c68b
---
e3c68b
 xlators/mgmt/glusterd/src/glusterd-svc-helper.c | 6 +++---
e3c68b
 1 file changed, 3 insertions(+), 3 deletions(-)
e3c68b
e3c68b
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
e3c68b
index 6a3ca52..a6e662f 100644
e3c68b
--- a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
e3c68b
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
e3c68b
@@ -488,9 +488,9 @@ glusterd_shd_svc_mux_init(glusterd_volinfo_t *volinfo, glusterd_svc_t *svc)
e3c68b
 
e3c68b
             if (!mux_proc) {
e3c68b
                 if (pid != -1 && sys_access(svc->proc.pidfile, R_OK) == 0) {
e3c68b
-                    /* stale pid file, unlink it. */
e3c68b
-                    kill(pid, SIGTERM);
e3c68b
-                    sys_unlink(svc->proc.pidfile);
e3c68b
+                    /* stale pid file, stop and unlink it */
e3c68b
+                    glusterd_proc_stop(&svc->proc, SIGTERM, PROC_STOP_FORCE);
e3c68b
+                    glusterd_unlink_file(svc->proc.pidfile);
e3c68b
                 }
e3c68b
                 mux_proc = __gf_find_compatible_svc(GD_NODE_SHD);
e3c68b
             }
e3c68b
-- 
e3c68b
1.8.3.1
e3c68b