-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal Code
-
Labels:
-
Server Security
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)