-
-
Notifications
You must be signed in to change notification settings - Fork 236
When killing a process, ensure it was killed #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello, I am trying to fix this issue, my idea was to alter the handler removeExitHandler // The handler in question
removeExitHandler = onExit(() => {
// Added instruction
setCheckKilled(spawned);
spawned.kill();
});
function setCheckKilled(spawned) {
setTimeout(() => {
checkDeath(spawned.pid, spawned.ppid, spawned.uid);
}, TIME_TO_CHECK_KILL);
}
function checkDeath(pid, ppid, uid) {
console.log(pid + " " + ppid + " " + uid)
findProcess.find("pid", pid).then((list) => compareFields({
"ppid": ppid,
"uid": uid
}, list));
} I was thinking of using the package find-process. So that I could get the information related to the process to compare to what I have stored. However I have come across a problem, with the information returned by the find-process package I do no have access to the process itself. That lead me to have a better look at the issue and raised a question. |
That package is way too bloated and not even needed for this purpose.
I don't understand what you're trying to do.
https://www.google.co.th/search?q="child+process"+vs+process |
I have already explained the solution in the issue text:
|
When a user does
child.kill()
(NOT whenchild.kill('SIGKILL')
), after some timeout (How long?), we should check if the process was actually killed withprocess.kill(0)
and doprocess.kill('SIGKILL')
if not.The text was updated successfully, but these errors were encountered: