SymbolicName = NSSM_EVENT_KILLING
Severity = Informational
Language = English
-kill_process_tree %1 %2 %3
+Killing process tree of process %2 for service %1 with exit code %3
.
MessageId = +1
_snprintf(ppid_string, sizeof(ppid_string), "%d", ppid);
log_event(EVENTLOG_INFORMATION_TYPE, NSSM_EVENT_KILL_PROCESS_TREE, pid_string, ppid_string, service_name, 0);
if (! kill_process(service_name, process_handle, pid, exitcode)) {
- log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_TERMINATEPROCESS_FAILED, pid_string, service_name, error_string(GetLastError()), 0);
+ /* Maybe it already died. */
+ unsigned long ret;
+ if (! GetExitCodeProcess(process_handle, &ret)) log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_TERMINATEPROCESS_FAILED, pid_string, service_name, error_string(GetLastError()), 0);
return;
}
}