[SERVER-26575] Unable to start mongod service when omiting pidfilepath in mongod.conf Created: 11/Oct/16 Updated: 04/Jan/17 Resolved: 13/Oct/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Packaging |
| Affects Version/s: | 3.2.10 |
| Fix Version/s: | 3.4.0-rc1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Harsh Patel | Assignee: | Brian Samek |
| Resolution: | Done | Votes: | 0 |
| Labels: | bkp | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
|||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | |||||||||||||||||||||||||||||||
| Operating System: | ALL | |||||||||||||||||||||||||||||||
| Backport Requested: |
v3.2
|
|||||||||||||||||||||||||||||||
| Steps To Reproduce: | 1. Populate a file named test.conf with yaml that does not contain a reference to pidfilepath:
2. Set the config file
3. Parse the pidfilepath
4. Run the check
5. Observe that the statement erroneously evaluates to true. |
|||||||||||||||||||||||||||||||
| Sprint: | Build 2016-10-31 | |||||||||||||||||||||||||||||||
| Participants: | ||||||||||||||||||||||||||||||||
| Description |
|
File: init.d-mongod The problem occurs when the contents of the $CONFIGFILE does not contain a reference to pidfilepath. In this case, the parsing results in a null string value for PIDFILEPATH. The if-statement that uses PIDFILEPATH does not quote the variable and so the if-statement will evaluate to true even though there is obviously no such 'null' file. This was observed when running
resulting in the error
Surrounding the PIDFILEPATH in quotes should fix the problem: if [ -f "$PIDFILEPATH" ]; The documentation states that the pidfilepath is not required: "Without a specified processManagement.pidFilePath option, the process creates no PID file." Appears to be resulting from the changes made in |
| Comments |
| Comment by Ramon Fernandez Marina [ 14/Oct/16 ] |
|
Thanks for the detailed bug report hpatel001. A fix has been committed to the master branch, and will be part of the upcoming 3.4.0-rc1 release candidate. The fix is a change in the init script, so if this bug is an issue for you it's easy to apply the fix to your existing installation. Regards, |
| Comment by Githook User [ 13/Oct/16 ] |
|
Author: {u'username': u'bsamek', u'name': u'Brian Samek', u'email': u'brian.samek@mongodb.com'}Message: |