In Centos 7.2 (did not test on other versions), if we modify the pidfilepath in the mongod.conf, the mongod service cannot be stopped. The solution was to change the pidfilepath in the /etc/init.d/mongod file.
Steps to reproduce the issue
- Stop mongod if running.
- Change the location of pidfilepath to something else
- Launch mongod
sudo service mongod start
- Stop mongod
sudo service mongod stop
It will return OK:
Stopping mongod (via systemctl): [ OK ]
- do a ps -ef | grep mongod. Mongod will still be there running.
Solution
- Edit the init.d script or the mongod.conf file so that the pidfilepath matches in both locations.
Thank you,
Davenson Lombard
- is duplicated by
-
SERVER-24295 mongod service pid is different in /var/run/mongo and actual running service pid
- Closed