Provide platform-independent method to whack the running process

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • Server Security
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When we run external daemons such as service mocks, we typically use stopMongoProgramByPid to terminate them. This invocation does not work the same way on all platforms, which leads to the need to use complex shutdown methodologies such as:

      
      function killPyKMIPServer(pid) {
          if (_isWindows()) {
              // we use taskkill because we need to kill children
              waitProgram(_startMongoProgram("taskkill", "/F", "/T", "/PID", pid));
              // waitProgram to ignore error code
              waitProgram(pid);
          } else {
              let kSIGINT = 2;
              stopMongoProgramByPid(pid, kSIGINT);
          }
      }
      

      This ticket is to research and implement a single function which would reliably terminate the process by PID on every platform, also killing children and gradually stepping up terminate signals on linux (SIGTERM, then SIGINT, then SIGKILL)

            Assignee:
            [DO NOT USE] Backlog - Security Team
            Reporter:
            Sergey Galtsev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: