[SERVER-6032] Windows service fails to start Created: 07/Jun/12 Updated: 15/Feb/13 Resolved: 20/Aug/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 2.0.6 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Travis Paxton | Assignee: | Tad Marshall |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 7 64-bit |
||
| Operating System: | Windows |
| Participants: |
| Description |
|
When I try to start the MongoDB service, I get the following:
I created the service using: C:\mongodb\bin\mongod.exe --install --dbpath=..\db --logpath=..\mongo.log --logappend -vvvvv When I run directly from the cmd console, it works fine. |
| Comments |
| Comment by Tad Marshall [ 20/Aug/12 ] | |||||||||||||||||||||||||||||||||||||
|
The "current working directory" of processes started by the Windows Service Control Manager will be C:\Windows\System32, so your dbpath of ..\db will be resolved as C:\Windows\db and your logpath will be resolved as C:\Windows\mongo.log. When I test your command on my system, the log file at C:\Windows\mongo.log is written and it contains this text:
If I create the directory C:\Windows\db, the service will start, but this is not a good place for a database directory. It would probably be better if mongod.exe had resolved the relative path to an absolute path at the time that you ran the --install command and then used an absolute path in the command line stored for starting the service. Feel free to file a Jira ticket suggesting this, or let me know and I can do it. | |||||||||||||||||||||||||||||||||||||
| Comment by Tad Marshall [ 07/Jun/12 ] | |||||||||||||||||||||||||||||||||||||
|
The --dbpath=..\db and --logpath=..\mongo.log will try to use relative directories based on the current directory of the service process, which may not be the intended location (and the location may not exist). Can you use fully-qualified paths and change "--install" to "--reinstall" and see if that fixes it? For example:
|