diff options
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 18 | 
1 files changed, 14 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 4224ecb2dae..27bf68d50e1 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -1654,10 +1654,20 @@ glusterd_service_stop_nolock (const char *service, char *pidfile, int sig,          if (kill(pid, 0) == 0) {                  ret = kill (pid, SIGKILL);                  if (ret) { -                        gf_msg (this->name, GF_LOG_ERROR, errno, -                                GD_MSG_PID_KILL_FAIL, "Unable to kill pid:%d, " -                                "reason:%s", pid, strerror(errno)); -                        goto out; +                        // Process is already dead, don't fail +                        if (errno == ESRCH) { +                                gf_msg (this->name, GF_LOG_ERROR, errno, +                                        GD_MSG_PID_KILL_FAIL, +                                        "Unable to find pid:%d, " +                                        "must be dead already. Ignoring.", pid); +                                ret = 0; +                        } else { +                                gf_msg (this->name, GF_LOG_ERROR, errno, +                                        GD_MSG_PID_KILL_FAIL, +                                        "Unable to kill pid:%d, " +                                        "reason:%s", pid, strerror(errno)); +                                goto out; +                        }                  }          }  | 
