<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:14:00 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-7252] Faulty command line is produced when installing as a service on Windows and using equal sign in options</title>
                <link>https://jira.mongodb.org/browse/SERVER-7252</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When you try to install mongod as a service on Windows specifying any of the --serviceName, --serviceDisplayName or --serviceDescription options using an equal sign to separate the option name from the option value, the command line produced for the service may be missing options and/or have leftover text and the service may not be able to be successfully started.&lt;/p&gt;

&lt;p&gt;Steps to reproduce&lt;/p&gt;

&lt;p&gt;1. Try to install mongod as a service with as below:&lt;br/&gt;
C:\Mongo\bin&amp;gt;mongod --install --serviceName=&quot;My Service&quot; --serviceDescription &quot;My Service&quot; --serviceDisplayName &quot;My Service&quot; --dbpath C:\mongo\data\config --port 20001 --logpath C:\mongo\logs\mongo_config.log.txt --configsvr&lt;/p&gt;

&lt;p&gt;2. Issue the following command &lt;br/&gt;
net start &quot;My Service&quot;&lt;/p&gt;

&lt;p&gt;3. Verify that the following error is reported:&lt;br/&gt;
The service is not responding to the control function&lt;/p&gt;

&lt;p&gt;4. WORKAROUND&lt;br/&gt;
 a. Go to the registry for this service (HKLM\SYSTEM\CurrentControlSet\services&amp;#41;&lt;br/&gt;
 b. Verify that in the ImagePath after --service there&apos;s a spurious &quot;My Service&quot; string (without quotes)&lt;br/&gt;
 c. remove that string and save&lt;br/&gt;
 d. verify that the service is now starting properly.&lt;/p&gt;</description>
                <environment>Windows 2008</environment>
        <key id="52274">SERVER-7252</key>
            <summary>Faulty command line is produced when installing as a service on Windows and using equal sign in options</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="schwerin@mongodb.com">Andy Schwerin</assignee>
                                    <reporter username="stefanoric">Stefano Ricciardi</reporter>
                        <labels>
                    </labels>
                <created>Thu, 4 Oct 2012 07:27:17 +0000</created>
                <updated>Mon, 11 Jul 2016 17:56:39 +0000</updated>
                            <resolved>Thu, 6 Dec 2012 15:18:18 +0000</resolved>
                                    <version>2.0.8</version>
                    <version>2.2.2</version>
                    <version>2.3.1</version>
                                    <fixVersion>2.3.2</fixVersion>
                                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="208066" author="schwerin" created="Thu, 6 Dec 2012 15:18:18 +0000"  >&lt;p&gt;The altered functionality is unit tested, but there is no facility to test installation/removal of Windows services in our automated test framework.  This was hand tested by following the &quot;steps to reproduce&quot; in the original ticket description.&lt;/p&gt;</comment>
                            <comment id="208064" author="auto" created="Thu, 6 Dec 2012 15:16:31 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-12-05T20:40:32Z&apos;, u&apos;email&apos;: u&apos;schwerin@10gen.com&apos;, u&apos;name&apos;: u&apos;Andy Schwerin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-7252&quot; title=&quot;Faulty command line is produced when installing as a service on Windows and using equal sign in options&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-7252&quot;&gt;&lt;del&gt;SERVER-7252&lt;/del&gt;&lt;/a&gt; Properly handle empty-string arguments in argv when generating a windows command line.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ce53447ced1d3c7ad26274dad8099f2bb199c2b0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ce53447ced1d3c7ad26274dad8099f2bb199c2b0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="207489" author="auto" created="Wed, 5 Dec 2012 22:05:57 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-12-04T22:40:02Z&apos;, u&apos;name&apos;: u&apos;Andy Schwerin&apos;, u&apos;email&apos;: u&apos;schwerin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-7252&quot; title=&quot;Faulty command line is produced when installing as a service on Windows and using equal sign in options&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-7252&quot;&gt;&lt;del&gt;SERVER-7252&lt;/del&gt;&lt;/a&gt; Produce correct commandline for Windows service for --install, --reinstall or --service.&lt;/p&gt;

&lt;p&gt;The service command line is derived from the mongod/mongos command line when Mongo is started with&lt;br/&gt;
--install, --reinstall and --service.  It does this by stripping out options that describe how to&lt;br/&gt;
install the service, and correctly quoting the arguments.  This patch makes this procedure more explicit,&lt;br/&gt;
and handles the equals sign and arguments with spaces and backslashes in the process.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c24aa0214b18d875236ff8f31e7bfe54fb537f61&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c24aa0214b18d875236ff8f31e7bfe54fb537f61&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="206627" author="auto" created="Tue, 4 Dec 2012 23:29:23 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-12-04T20:15:40Z&apos;, u&apos;name&apos;: u&apos;Andy Schwerin&apos;, u&apos;email&apos;: u&apos;schwerin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-7252&quot; title=&quot;Faulty command line is produced when installing as a service on Windows and using equal sign in options&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-7252&quot;&gt;&lt;del&gt;SERVER-7252&lt;/del&gt;&lt;/a&gt; Introduce and test function for building a Windows command line from an argument vector.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/0753b2b2a5ed8e70763d50e6945aea72f0e9f372&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/0753b2b2a5ed8e70763d50e6945aea72f0e9f372&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="203274" author="tad" created="Fri, 30 Nov 2012 16:35:59 +0000"  >&lt;p&gt;There is another issue caused by poor handling of equals signs used with options: this causes the filename parameters to be unrecognized by name, leading to a failure to re-quote them.  This case does not involve the --service* parameters.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;C:\mongo&amp;gt; mongod --install --dbpath=&quot;U:\Special Location&quot; --logpath=&quot;L:\Special Log Location\mongod.log&quot;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;produces&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;&quot;C:\mongo\mongod.exe&quot; --service --dbpath=U:\Special Location --logpath=L:\Special Log Location\mongod.log&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This will also fail to start due to the unquoted file paths.&lt;/p&gt;</comment>
                            <comment id="203179" author="tad" created="Fri, 30 Nov 2012 15:03:49 +0000"  >&lt;p&gt;I verified that this is a bug.  It&apos;s been in every version since the Windows Service feature was introduced, and affects mongos as well as mongod.&lt;/p&gt;

&lt;p&gt;The bug is triggered in this example by using an equal sign between &quot;&amp;#45;-serviceName&quot; and the text &quot;My Service&quot;.  Boost::program_options correctly parses this as an option with key &quot;serviceName&quot; and value &quot;My Service&quot;, but our logic for constructing the command line for the service uses the original argc and argv as provided by Windows.&lt;/p&gt;

&lt;p&gt;Windows considers &apos;&amp;#45;-serviceName=&quot;My Service&quot;&apos; to be a single argument.  Our logic removes all arguments that begin with &quot;&amp;#45;-service&quot; or &quot;-service&quot; and also removes the argument that follows, which is assumed to be the value associated with the key.  In this case, it removes the key &quot;&amp;#45;-serviceDescription&quot;.  This leaves &quot;My Service&quot; as an &quot;unknown&quot; key, which is then copied verbatim into the constructed command line.&lt;/p&gt;

&lt;p&gt;Using a different example command line, this bug could produce a start-able service, but one in which important parameters are missing.  Consider this case:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;C:\mongo&amp;gt; mongod &amp;#45;-install &amp;#45;-serviceName=&quot;Name&quot; &amp;#45;-dbpath=&quot;U:\SpecialLocation&quot; &amp;#45;-serviceDescription=&quot;Description&quot; &amp;#45;-port=20001 &amp;#45;-serviceDisplayName=&quot;DisplayName&quot; --rest &amp;#45;-logpath=&quot;L:\SpecialLogLocation\mongod.log&quot;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This command will result in this command line for the service:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;&quot;C:\mongo\mongod.exe&quot; &amp;#45;-service &amp;#45;-logpath=L:\SpecialLogLocation\mongod.log&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The incorrect parsing of &apos;serviceName&apos; caused &apos;dbpath&apos; to be skipped, the incorrect parsing of &apos;serviceDescription&apos; caused &apos;port&apos; to be skipped and the incorrect parsing of &apos;serviceDisplayName&apos; caused &apos;rest&apos; to be skipped.&lt;/p&gt;

&lt;p&gt;The workaround, besides editing an incorrect registry entry, is to separate parameter keys and values with a space instead of an equal sign.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 4 Oct 2012 15:17:56 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 10 weeks, 6 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>false</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 10 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[Windows]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>stefanoric</customfieldvalue>
            <customfieldvalue>tad</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrnmf3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrjq27:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>28745</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10166" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Tests Written</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10340"><![CDATA[Pending Test Framework Changes]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht0513:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>