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

Remove --service from the command line arguments in windows. Let the program auto-detect if it is running in the SCM or not

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4
    • Fix Version/s: Backlog
    • Component/s: Usability
    • Labels:
      None
    • Environment:
      Windows NT

      Description

      Currently Mongo has a switch --service that is supposed tgo be passed to it when it is run as an NT service. This is unnecessary and against best practice on windows.

      Currently --service causes StartServiceCtrlDispatcher() to be called in windows. However, as per the MSDN documentation for StartServiceCtrlDispatcher() if it is invoked from a console (cmd.exe) it returns ERROR_FAILED_SERVICE_CONTROLLER_CONNECT. As per http://msdn.microsoft.com/en-us/library/ms686324(VS.85).aspx:

      This error is returned if the program is being run as a console application rather than as a service. If the program will be run as a console application for debugging purposes, structure it such that service-specific code is not called when this error is returned.

      Therefore, StartServiceCtrlDispatcher() should always be called in main() in db.cpp, properly #ifdef'ed --service should be deprecated, doing nothing but emitting a message to log(). Also, this ticket should be linked to SERVER-733 because logging should be fixed as well.

        Attachments

          Activity

            People

            Assignee:
            backlog-server-platform DO NOT USE - Backlog - Platform Team
            Reporter:
            zippy1981 Justin Dearing
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated: