Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-3314

manual windows service creation steps do not work

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • v1.3.4
    • manual
    • None
    • Windows 2012
    • 4
    • false

    Description

      The instructions for manually creating a Windows service as a workaround to SERVER-13515 do not work on Windows 2012 with the default Windows Power Shell. Even if you take care to quote the double quotes and include spaces in the right places, the sc.exe command will not accept the command. It will just spit out the usage statement instead of telling you what is wrong.

      The documentation tells you to type this:

      sc.exe create MongoDB binPath= "\"C:\Program Files\MongoDB 2.6 Enterprise\bin\mongod.exe\" --service --config=\"C:\Program Files\MongoDB 2.6 Standard\mongod.cfg\"" DisplayName= "MongoDB 2.6 Standard" start= "auto"

      ... but removing all extraneous double quotes by referring to directories with non-space filenames was the only way I could get it to work on Windows 2012:

      sc.exe create MongoDB binPath= "c:\progra~1\mongod~1.6st\bin\mongod.exe --service --config=c:\progra~1\mongod~1.6st\mongod.cfg" DisplayName= "MongoDB 2.6 Standard" start= "auto"

      This bug affects:

      • includes/steps-create-manually-windows-service-for-mongodb.yaml
      • includes/steps-create-manually-windows-service-for-mongodb-enterprise.yaml

      It will likely be a non-issue once 2.6.1 is generally available.

      There is a proposed workaround on stackoverflow that suggests using environment variables in powershell like the following example, but I have not tried it:

      {sc.exe create svnserve binpath= "${env:programfiles(x86)}/subversion/bin/svnserve.exe --service -r C:/svnrepositories/" displayname= "Subversion Server" depend= Tcpip start= auto}

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            jake.angerman Jake Angerman
            Jonathan Dahl Jonathan Dahl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              8 years, 15 weeks, 5 days ago