Try to kill the process tree gracefully.
[nssm.git] / service.cpp
index 4bcf8ab..8e56cf7 100644 (file)
@@ -288,7 +288,7 @@ int stop_service(unsigned long exitcode, bool graceful, bool default_action) {
   if (pid) {\r
     /* Shut down server */\r
     log_event(EVENTLOG_INFORMATION_TYPE, NSSM_EVENT_TERMINATEPROCESS, service_name, exe, 0);\r
-    TerminateProcess(process_handle, 0);\r
+    kill_process(service_name, process_handle, pid, 0);\r
     process_handle = 0;\r
   }\r
   else log_event(EVENTLOG_INFORMATION_TYPE, NSSM_EVENT_PROCESS_ALREADY_STOPPED, service_name, exe, 0);\r