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

RHEL init.d script does not handle pidFilePath with quotes

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.0
    • Component/s: None
    • None
    • ALL
    • Hide
      1. Install MongoDB 3.0.0 under RHEL 6
      2. Set the pidFilePath in a YAML formatted mongod.conf file as follows
        processManagement:
            pidFilePath: "/var/run/mongodb/mongod.pid"
        
      3. Start mongod
        sudo service mongod start
        
      4. Stop mongod
        sudo service mongod stop
        // This service command will fail
        
      Show
      Install MongoDB 3.0.0 under RHEL 6 Set the pidFilePath in a YAML formatted mongod.conf file as follows processManagement: pidFilePath: "/ var /run/mongodb/mongod.pid" Start mongod sudo service mongod start Stop mongod sudo service mongod stop // This service command will fail

      The RHEL mongod init.d script will fail to shut down mongod when the value of processManagement.pidFilePath is set to a quoted string. This occurs because the quote characters are interpreted by the script as part of the filename and no match is found for the pid file. For example, stopping/restarting mongod fails with the following format:

      processManagement:
          pidFilePath: "/var/run/mongodb/mongod.pid"
      

      and succeeds when the quotes are removed:

      processManagement:
          pidFilePath: /var/run/mongodb/mongod.pid
      

      YAML formatted strings can be represented with single quotes, double quotes or no quotes when leading/trailing space truncation is not an issue. We should handle all cases in our init.d script.

            Assignee:
            Unassigned Unassigned
            Reporter:
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: