[SERVER-17546] RHEL init.d script does not handle pidFilePath with quotes Created: 11/Mar/15  Updated: 12/Mar/15  Resolved: 12/Mar/15

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 3.0.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: James Wahlin Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
duplicates SERVER-17389 YAML pidFilePath not handled correctl... Closed
duplicates SERVER-17337 RPM Init script breaks with quotes in... Closed
Operating System: ALL
Steps To Reproduce:
  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
    

Participants:

 Description   

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.


Generated at Thu Feb 08 03:44:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.