summaryrefslogtreecommitdiff
path: root/rpm
diff options
context:
space:
mode:
authorMathew Robinson <chasinglogic@gmail.com>2019-06-04 15:44:33 -0400
committerMathew Robinson <chasinglogic@gmail.com>2019-06-06 11:53:25 -0400
commit65daaae2ffa01cbb741db69922b5f7cd4ed7836b (patch)
tree367396a4269a35724882202f88026c4a43729138 /rpm
parente5115d5bf9761ba1bbaf058830bea713ef1cf9fc (diff)
downloadmongo-65daaae2ffa01cbb741db69922b5f7cd4ed7836b.tar.gz
SERVER-41546 SysV init scripts should verify PIDfile exists instead of failing
Diffstat (limited to 'rpm')
-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.