summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathew Robinson <chasinglogic@gmail.com>2019-06-04 15:44:33 -0400
committerMathew Robinson <chasinglogic@gmail.com>2019-06-07 14:00:48 -0400
commitac4fdad1f38343b167aaf38576f44651c7734c3d (patch)
tree2212d1b368e314af234f7576bf1c0adeb95af750
parente78eb1b7172aa23a7ce26bf01ccd2e8a61e31076 (diff)
downloadmongo-ac4fdad1f38343b167aaf38576f44651c7734c3d.tar.gz
SERVER-41546 SysV init scripts should verify PIDfile exists instead of failing
(cherry picked from commit 65daaae2ffa01cbb741db69922b5f7cd4ed7836b)
-rwxr-xr-xrpm/init.d-mongod5
1 files changed, 5 insertions, 0 deletions
diff --git a/rpm/init.d-mongod b/rpm/init.d-mongod
index b4f5a662a9e..9b228203163 100755
--- a/rpm/init.d-mongod
+++ b/rpm/init.d-mongod
@@ -100,6 +100,11 @@ mongo_killproc()
local -i duration=10
local pid=`pidofproc -p "${pid_file}" ${procname}`
+ if [ ! -f "${pid_file}" ]; then
+ echo "No PID file detected, nothing to stop"
+ exit 0
+ fi
+
# Per the man page the process name should always be the second
# field. In our case mongod is wrapped in parens hence the parens in
# the if condition below.