summaryrefslogtreecommitdiff
path: root/src/mongo/util/ntservice.h
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2012-12-04 17:40:02 -0500
committerAndy Schwerin <schwerin@10gen.com>2012-12-05 17:05:37 -0500
commitc24aa0214b18d875236ff8f31e7bfe54fb537f61 (patch)
tree08d0fc40af7d77483b67ef8d6980230639bf214b /src/mongo/util/ntservice.h
parent1e7a83f9f97e4ee92c65ec9d9758c479b56b89cf (diff)
downloadmongo-c24aa0214b18d875236ff8f31e7bfe54fb537f61.tar.gz
SERVER-7252 Produce correct commandline for Windows service for --install, --reinstall or --service.
The service command line is derived from the mongod/mongos command line when Mongo is started with --install, --reinstall and --service. It does this by stripping out options that describe how to install the service, and correctly quoting the arguments. This patch makes this procedure more explicit, and handles the equals sign and arguments with spaces and backslashes in the process.
Diffstat (limited to 'src/mongo/util/ntservice.h')
-rw-r--r--src/mongo/util/ntservice.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/util/ntservice.h b/src/mongo/util/ntservice.h
index 5a0200ac8ed..68d32037144 100644
--- a/src/mongo/util/ntservice.h
+++ b/src/mongo/util/ntservice.h
@@ -63,6 +63,16 @@ namespace ntservice {
bool shouldStartService();
/**
+ * Construct an argv array that Windows should use to start mongod/mongos as a service
+ * if mongo was started with "inputArgv", which is assumed to be an argument vector that
+ * dictates that Windows should install mongo as a service.
+ *
+ * The result is suitable for passing to mongo::constructUtf8WindowsCommandLine() to construct
+ * a properly quoted command line string.
+ */
+ std::vector<std::string> constructServiceArgv(const std::vector<std::string>& inputArgv);
+
+ /**
* Start the service. Never returns.
*/
MONGO_COMPILER_NORETURN void startService();