SERVER-41546 SysV init scripts should verify PIDfile exists instead of failing

This commit is contained in:
Mathew Robinson 2019-06-04 15:44:33 -04:00
parent e5115d5bf9
commit 65daaae2ff
1 changed files with 5 additions and 0 deletions

View File

@ -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.