Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-5457

Service install with dbpath ending in backslash results in non-runnable service.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.0.3
    • Component/s: Packaging
    • Environment:
      Windows 7 SP1
    • Windows

      The following command:

      c:\SitesData\survey.unifocus.com\mongo\mongod.exe --rest --replSet rsUfSurvey --dbpath C:\SitesData\survey.unifocus.com\mongodata_test27022\ --serviceName Mongo27022 --serviceDisplayName "MongoDB 27022" --serviceDescription "Instance of mongod.exe listening on TCP port 27022" --logpath C:\SitesData\survey.unifocus.com\mongo_27022.log --logappend --port 27022 --install

      creates a service with a HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MongoDB\ImagePath value of:

      "c:\SitesData\survey.unifocus.com\mongo\mongod.exe" --rest  --replSet  rsUfSurvey  --dbpath  "C:\SitesData\survey.unifocus.com\mongodata_test27022\"  --logpath  "C:\SitesData\survey.unifocus.com\mongo_27022.log"  --logappend  --port  27022  --service

      When atetmpting to start the service using NET START Mongo27022, the following error message is given:

      The service is not responding to the control function.

      If I try to manually run the ImagePath value without "--service" on the end, I get the following error:

      Fri Mar 30 08:57:05 [initandlisten] exception in initAndListen: 10296 dbpath (C:\SitesData\survey.unifocus.com\mongodata_test27022"  --logpath  C:\SitesData\survey.unifocus.com\mongo_27022.log  --logappend  --port  27022) does not exist, terminating

      Evidently, the backslash at the end of the dbpath is being treated as an escape sequence and preventing the quotes (which were added automatically by --install !) from closing correctly.

      A suitable workaround is obviously to not put a backslash character at the end of the dbpath, but it definitely had me scratching my head for a bit!

            Assignee:
            Unassigned Unassigned
            Reporter:
            mcassidy Mo Cassidy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: