[SERVER-4410] Windows Service --install option isn't quoting all file parameters Created: 02/Dec/11  Updated: 11/Jul/16  Resolved: 02/Dec/11

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 2.0.7
Fix Version/s: 2.1.0

Type: Bug Priority: Major - P3
Reporter: Tad Marshall Assignee: Tad Marshall
Resolution: Done Votes: 0
Labels: Windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows install as a service


Issue Links:
Duplicate
is duplicated by SERVER-6453 Errno:22 problem opening logfile usin... Closed
is duplicated by SERVER-3915 Installing mongod as a windows servic... Closed
is duplicated by SERVER-5275 When installing MongoDB as a Windows ... Closed
Backwards Compatibility: Fully Compatible
Operating System: Windows
Participants:

 Description   

When setting up mongod.exe to run as a service on Windows by specifying the --install command line switch, the --dbpath and --logpath options are correctly quoted when reinserted into the command line that gets set up to be run by the Windows Service Controller. --config, --pidfilepath and perhaps others need the same quoting treatment, otherwise paths and filenames that contain spaces will mess up the parsing of the command line, leading to mongod services that don't start or don't start correctly.

User's command line:

mongod --install --dbpath "C:\My mongo folder" --pidfilepath "C:\My mongo folder\pidfile"

Resulting command line:

"C:\My mongo folder\mongod.exe" --dbpath "C:\My mongo folder" --pidfilepath C:\My mongo folder\pidfile --service

Without quotes (reinserted) around C:\My mongo folder\pidfile , this is not going to work.



 Comments   
Comment by auto [ 02/Dec/11 ]

Author:

{u'login': u'', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-4410 – Windows Service --install option isn't quoting all file parameters

Added quoting code for --pidfilepath, --config, -f, --repairpath and --keyfile.
I think that's all of the current options that can accept filespecs (whether or
not they make sense for a service).
Branch: master
https://github.com/mongodb/mongo/commit/460294e5067d4230ef25997f1503c842a9e1c515

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