Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-23830

On RHEL7/Centos7 mongod can't stop if pid location in conf differs from the init.d script

    • Fully Compatible
    • Build 15 (06/03/16), Build 16 (06/24/16), Build 17 (07/15/16)

      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

      1. Stop mongod if running.
      2. Change the location of pidfilepath to something else
      3. Launch mongod
        sudo service mongod start
      4. Stop mongod
        sudo service mongod stop

        It will return OK:

        Stopping mongod (via systemctl):                           [  OK  ]
      5. do a ps -ef | grep mongod. Mongod will still be there running.


      • Edit the init.d script or the mongod.conf file so that the pidfilepath matches in both locations.

      Thank you,

      Davenson Lombard

            ernie.hershey@mongodb.com Ernie Hershey (Inactive)
            davenson.lombard@mongodb.com Davenson Lombard
            1 Vote for this issue
            7 Start watching this issue