[SERVER-13463] Relative path in config file for mongod.exe not working when installing window service Created: 02/Apr/14 Updated: 08/Feb/23 Resolved: 20/May/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin |
| Affects Version/s: | 2.4.9 |
| Fix Version/s: | 2.7.2 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Donny V | Assignee: | Mark Benvenuto |
| Resolution: | Done | Votes: | 0 |
| Labels: | configuration, windows | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 7 64bit & Windows Server 2008 R2 SP1 64bit |
||
| Attachments: |
|
||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||
| Operating System: | Windows | ||||||||||||||||||||||||
| Sprint: | Server 2.7.2 | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Description |
|
When I try to create a windows service with a config file that |
| Comments |
| Comment by Githook User [ 20/May/14 ] |
|
Author: {u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}Message: The current working directory for NT Services differs between installation time |
| Comment by Mark Benvenuto [ 02/Apr/14 ] |
|
Relative paths are sensitive to the current working directory. With NT Services, the current working directory varies between installation time (i.e., it may be c:\mongo as an example) while during service execution time it will be c:\windows\system32 (as an example). This means that during installation time of the service, your data directory may be "c:\mongo\data\db" (if you ran it from c:\mongo) but during service execution time it would be "c:\windows\system32\data\db" because the current working directories differ. |
| Comment by Donny V [ 02/Apr/14 ] |
|
Not sure why setting the relative path for the database and log folder should effect how the service gets created. |
| Comment by Mark Benvenuto [ 02/Apr/14 ] |
|
The working directory for an NT Service is %WINDIR%\System32 instead of the directory where you ran the --install command. This is why the relative paths in the config file failed. Use an absolute to path (d:\log, etc) to fix this. In the future, we will likely error to prevent problems in the future. |