diff options
author | Mathew Robinson <chasinglogic@gmail.com> | 2019-06-04 15:44:33 -0400 |
---|---|---|
committer | Mathew Robinson <chasinglogic@gmail.com> | 2019-06-07 14:00:48 -0400 |
commit | ac4fdad1f38343b167aaf38576f44651c7734c3d (patch) | |
tree | 2212d1b368e314af234f7576bf1c0adeb95af750 | |
parent | e78eb1b7172aa23a7ce26bf01ccd2e8a61e31076 (diff) | |
download | mongo-ac4fdad1f38343b167aaf38576f44651c7734c3d.tar.gz |
SERVER-41546 SysV init scripts should verify PIDfile exists instead of failing
(cherry picked from commit 65daaae2ffa01cbb741db69922b5f7cd4ed7836b)
-rwxr-xr-x | rpm/init.d-mongod | 5 |
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. |