Details
Description
I believe this problem may have been misdiagnosed. I'm seeing this issue on CentOS-6.5 with `mongodb-org-server-3.0.3-1.el6.x86_64`
The problem is that `service mongod stop` reports that mongo was successfully stopped.
# service mongod stop
|
Stopping mongod: [ OK ]
|
However, hours later `mongod` is still running:
# service mongod status
|
mongod (pid 22345) is running...
|
Repeated attempts to stop mongod are unsuccessful:
# service mongod stop
|
Stopping mongod: [ OK ]
|
# service mongod status
|
mongod (pid 22345) is running...
|
The problem is that the pidfile has been removed, but mongod is still running. The current initscript uses a shell function mongo_killproc which relies on the function pidofproc to determine the pid of a running mongo. This function does not work when the pid file has been removed, but mongo is still running.
# service mongod status
|
mongod (pid 22345) is running...
|
|
# cat /var/run/mongodb/mongod.pid
|
cat: /var/run/mongodb/mongod.pid: No such file or directory
|
|
# pidof mongod ; echo $?
|
22345
|
0
|
|
# pidofproc -p /var/run/mongod/mongod.pid mongod ; echo $?
|
3
|
The solution (for CentOS-6.5) appears to be using pidof rather than pidofproc in mongo_killproc
Attachments
Issue Links
- is related to
-
SERVER-21668 Mongo not stopping on 3.0.7
-
- Closed
-