summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2019-05-30 23:48:05 +0530
committerAtin Mukherjee <amukherj@redhat.com>2019-05-31 03:21:57 +0000
commit5866f5e9b09bc10dfb1631b5636c5b7870fc61ff (patch)
treef1da4d4e87a47200d0c356f84ecc867e518101d1 /xlators
parente9ec61c9fc264c813bb9ed06891e2294870a50bc (diff)
glusterd/svc: Stop stale process using the glusterd_proc_stop
While restarting a glusterd process, when we have a stale pid we were doing a simple kill. Instead we can use glusterd_proc_stop Because it has more logging plus force kill in case if there is any problem with kill signal handling. Change-Id: I4a2dadc210a7a65762dd714e809899510622b7ec updates: bz#1710054 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-svc-helper.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
index f53bd417e05..55f4a489702 100644
--- a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
@@ -486,9 +486,9 @@ glusterd_shd_svc_mux_init(glusterd_volinfo_t *volinfo, glusterd_svc_t *svc)
if (!mux_proc) {
if (pid != -1 && sys_access(svc->proc.pidfile, R_OK) == 0) {
- /* stale pid file, unlink it. */
- kill(pid, SIGTERM);
- sys_unlink(svc->proc.pidfile);
+ /* stale pid file, stop and unlink it */
+ glusterd_proc_stop(&svc->proc, SIGTERM, PROC_STOP_FORCE);
+ glusterd_unlink_file(svc->proc.pidfile);
}
mux_proc = __gf_find_compatible_svc(GD_NODE_SHD);
}