How can I reap a zombie process that is not a child of my shell?

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have a server with a ton of zombie processes. Almost a thousand. If possible, I would like to reap these processes because it doesn't seem like the parent (one parent is causing all 1000 zombies) is going to call the wait function. I see bash has a builtin wait function, but when I use it to try to reap one of the zombies, I get the following error.
# wait 17517
bash: wait: pid 17517 is not a child of this shell
I am root, but that does not seem to make a difference. I have a couple questions
- Can I reap a zombie process if it is not the child of my shell?
- If not, is there anything I can do? I am not certain I should kill the parent
- Should I be worried? It seems the parent has a resource leak and is not garbage collecting or whatever.
process zombie-process
 |Â
show 2 more comments
up vote
1
down vote
favorite
I have a server with a ton of zombie processes. Almost a thousand. If possible, I would like to reap these processes because it doesn't seem like the parent (one parent is causing all 1000 zombies) is going to call the wait function. I see bash has a builtin wait function, but when I use it to try to reap one of the zombies, I get the following error.
# wait 17517
bash: wait: pid 17517 is not a child of this shell
I am root, but that does not seem to make a difference. I have a couple questions
- Can I reap a zombie process if it is not the child of my shell?
- If not, is there anything I can do? I am not certain I should kill the parent
- Should I be worried? It seems the parent has a resource leak and is not garbage collecting or whatever.
process zombie-process
Any solution I can think of would involve stopping the parent and forcing it to execute some system calls (waitandsignal(SIGCHLD,SIG_IGN)). Do you know anything about what the parent is doing when it's not creating children? Is it just listening on a socket?
â Mark Plotnick
Aug 28 at 18:16
@Mark Plotnick Unfortunately, I can't seem to find much about the parent. It is what you would call, a custom application. I would not be able to get more information on my own.
â Timothy Pulliam
Aug 28 at 18:19
I'd be more worried about why the zombie processes exist than trying to reap them outside of the parent process. Are they zombies themselves causing any harm?
â Christian Gibbons
Aug 28 at 18:24
@ChristianGibbons The system seems pretty slow to respond. Probably related. I am just worried that left to themselves, the system will crash. There are no signs of stopping.
â Timothy Pulliam
Aug 28 at 18:30
2
Zombie processes only occupy space in the process table, they wouldnâÂÂt explain unresponsiveness.
â Stephen Kitt
Aug 28 at 18:36
 |Â
show 2 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a server with a ton of zombie processes. Almost a thousand. If possible, I would like to reap these processes because it doesn't seem like the parent (one parent is causing all 1000 zombies) is going to call the wait function. I see bash has a builtin wait function, but when I use it to try to reap one of the zombies, I get the following error.
# wait 17517
bash: wait: pid 17517 is not a child of this shell
I am root, but that does not seem to make a difference. I have a couple questions
- Can I reap a zombie process if it is not the child of my shell?
- If not, is there anything I can do? I am not certain I should kill the parent
- Should I be worried? It seems the parent has a resource leak and is not garbage collecting or whatever.
process zombie-process
I have a server with a ton of zombie processes. Almost a thousand. If possible, I would like to reap these processes because it doesn't seem like the parent (one parent is causing all 1000 zombies) is going to call the wait function. I see bash has a builtin wait function, but when I use it to try to reap one of the zombies, I get the following error.
# wait 17517
bash: wait: pid 17517 is not a child of this shell
I am root, but that does not seem to make a difference. I have a couple questions
- Can I reap a zombie process if it is not the child of my shell?
- If not, is there anything I can do? I am not certain I should kill the parent
- Should I be worried? It seems the parent has a resource leak and is not garbage collecting or whatever.
process zombie-process
process zombie-process
asked Aug 28 at 18:12
Timothy Pulliam
1,051617
1,051617
Any solution I can think of would involve stopping the parent and forcing it to execute some system calls (waitandsignal(SIGCHLD,SIG_IGN)). Do you know anything about what the parent is doing when it's not creating children? Is it just listening on a socket?
â Mark Plotnick
Aug 28 at 18:16
@Mark Plotnick Unfortunately, I can't seem to find much about the parent. It is what you would call, a custom application. I would not be able to get more information on my own.
â Timothy Pulliam
Aug 28 at 18:19
I'd be more worried about why the zombie processes exist than trying to reap them outside of the parent process. Are they zombies themselves causing any harm?
â Christian Gibbons
Aug 28 at 18:24
@ChristianGibbons The system seems pretty slow to respond. Probably related. I am just worried that left to themselves, the system will crash. There are no signs of stopping.
â Timothy Pulliam
Aug 28 at 18:30
2
Zombie processes only occupy space in the process table, they wouldnâÂÂt explain unresponsiveness.
â Stephen Kitt
Aug 28 at 18:36
 |Â
show 2 more comments
Any solution I can think of would involve stopping the parent and forcing it to execute some system calls (waitandsignal(SIGCHLD,SIG_IGN)). Do you know anything about what the parent is doing when it's not creating children? Is it just listening on a socket?
â Mark Plotnick
Aug 28 at 18:16
@Mark Plotnick Unfortunately, I can't seem to find much about the parent. It is what you would call, a custom application. I would not be able to get more information on my own.
â Timothy Pulliam
Aug 28 at 18:19
I'd be more worried about why the zombie processes exist than trying to reap them outside of the parent process. Are they zombies themselves causing any harm?
â Christian Gibbons
Aug 28 at 18:24
@ChristianGibbons The system seems pretty slow to respond. Probably related. I am just worried that left to themselves, the system will crash. There are no signs of stopping.
â Timothy Pulliam
Aug 28 at 18:30
2
Zombie processes only occupy space in the process table, they wouldnâÂÂt explain unresponsiveness.
â Stephen Kitt
Aug 28 at 18:36
Any solution I can think of would involve stopping the parent and forcing it to execute some system calls (
wait and signal(SIGCHLD,SIG_IGN)). Do you know anything about what the parent is doing when it's not creating children? Is it just listening on a socket?â Mark Plotnick
Aug 28 at 18:16
Any solution I can think of would involve stopping the parent and forcing it to execute some system calls (
wait and signal(SIGCHLD,SIG_IGN)). Do you know anything about what the parent is doing when it's not creating children? Is it just listening on a socket?â Mark Plotnick
Aug 28 at 18:16
@Mark Plotnick Unfortunately, I can't seem to find much about the parent. It is what you would call, a custom application. I would not be able to get more information on my own.
â Timothy Pulliam
Aug 28 at 18:19
@Mark Plotnick Unfortunately, I can't seem to find much about the parent. It is what you would call, a custom application. I would not be able to get more information on my own.
â Timothy Pulliam
Aug 28 at 18:19
I'd be more worried about why the zombie processes exist than trying to reap them outside of the parent process. Are they zombies themselves causing any harm?
â Christian Gibbons
Aug 28 at 18:24
I'd be more worried about why the zombie processes exist than trying to reap them outside of the parent process. Are they zombies themselves causing any harm?
â Christian Gibbons
Aug 28 at 18:24
@ChristianGibbons The system seems pretty slow to respond. Probably related. I am just worried that left to themselves, the system will crash. There are no signs of stopping.
â Timothy Pulliam
Aug 28 at 18:30
@ChristianGibbons The system seems pretty slow to respond. Probably related. I am just worried that left to themselves, the system will crash. There are no signs of stopping.
â Timothy Pulliam
Aug 28 at 18:30
2
2
Zombie processes only occupy space in the process table, they wouldnâÂÂt explain unresponsiveness.
â Stephen Kitt
Aug 28 at 18:36
Zombie processes only occupy space in the process table, they wouldnâÂÂt explain unresponsiveness.
â Stephen Kitt
Aug 28 at 18:36
 |Â
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
- Can I reap a zombie process if it is not the child of my shell?
No, you can't.
- If not, is there anything I can do? I am not certain I should kill the parent
You can try to stop the parent, then restart it with exec from a shell that ignores SIGCHLD. A parent that ignores SIGCHLD won't leave zombies.
- Should I be worried? It seems the parent has a resource leak and is not garbage collecting or whatever.
If the number of zombies increases, eventually you will reach the point where you can't fork new processes.
with a creative use of gdb, one could make the parent actually call signal(SIGCHLD, SIG_IGN) and a few waitpid(-1,NULL,WNOHANG) to plug the leak without restarting it. Of course gdb and production might not go well together.
â A.B
Aug 29 at 22:04
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
- Can I reap a zombie process if it is not the child of my shell?
No, you can't.
- If not, is there anything I can do? I am not certain I should kill the parent
You can try to stop the parent, then restart it with exec from a shell that ignores SIGCHLD. A parent that ignores SIGCHLD won't leave zombies.
- Should I be worried? It seems the parent has a resource leak and is not garbage collecting or whatever.
If the number of zombies increases, eventually you will reach the point where you can't fork new processes.
with a creative use of gdb, one could make the parent actually call signal(SIGCHLD, SIG_IGN) and a few waitpid(-1,NULL,WNOHANG) to plug the leak without restarting it. Of course gdb and production might not go well together.
â A.B
Aug 29 at 22:04
add a comment |Â
up vote
2
down vote
accepted
- Can I reap a zombie process if it is not the child of my shell?
No, you can't.
- If not, is there anything I can do? I am not certain I should kill the parent
You can try to stop the parent, then restart it with exec from a shell that ignores SIGCHLD. A parent that ignores SIGCHLD won't leave zombies.
- Should I be worried? It seems the parent has a resource leak and is not garbage collecting or whatever.
If the number of zombies increases, eventually you will reach the point where you can't fork new processes.
with a creative use of gdb, one could make the parent actually call signal(SIGCHLD, SIG_IGN) and a few waitpid(-1,NULL,WNOHANG) to plug the leak without restarting it. Of course gdb and production might not go well together.
â A.B
Aug 29 at 22:04
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
- Can I reap a zombie process if it is not the child of my shell?
No, you can't.
- If not, is there anything I can do? I am not certain I should kill the parent
You can try to stop the parent, then restart it with exec from a shell that ignores SIGCHLD. A parent that ignores SIGCHLD won't leave zombies.
- Should I be worried? It seems the parent has a resource leak and is not garbage collecting or whatever.
If the number of zombies increases, eventually you will reach the point where you can't fork new processes.
- Can I reap a zombie process if it is not the child of my shell?
No, you can't.
- If not, is there anything I can do? I am not certain I should kill the parent
You can try to stop the parent, then restart it with exec from a shell that ignores SIGCHLD. A parent that ignores SIGCHLD won't leave zombies.
- Should I be worried? It seems the parent has a resource leak and is not garbage collecting or whatever.
If the number of zombies increases, eventually you will reach the point where you can't fork new processes.
answered Aug 28 at 21:57
RalfFriedl
3,9151625
3,9151625
with a creative use of gdb, one could make the parent actually call signal(SIGCHLD, SIG_IGN) and a few waitpid(-1,NULL,WNOHANG) to plug the leak without restarting it. Of course gdb and production might not go well together.
â A.B
Aug 29 at 22:04
add a comment |Â
with a creative use of gdb, one could make the parent actually call signal(SIGCHLD, SIG_IGN) and a few waitpid(-1,NULL,WNOHANG) to plug the leak without restarting it. Of course gdb and production might not go well together.
â A.B
Aug 29 at 22:04
with a creative use of gdb, one could make the parent actually call signal(SIGCHLD, SIG_IGN) and a few waitpid(-1,NULL,WNOHANG) to plug the leak without restarting it. Of course gdb and production might not go well together.
â A.B
Aug 29 at 22:04
with a creative use of gdb, one could make the parent actually call signal(SIGCHLD, SIG_IGN) and a few waitpid(-1,NULL,WNOHANG) to plug the leak without restarting it. Of course gdb and production might not go well together.
â A.B
Aug 29 at 22:04
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f465358%2fhow-can-i-reap-a-zombie-process-that-is-not-a-child-of-my-shell%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Any solution I can think of would involve stopping the parent and forcing it to execute some system calls (
waitandsignal(SIGCHLD,SIG_IGN)). Do you know anything about what the parent is doing when it's not creating children? Is it just listening on a socket?â Mark Plotnick
Aug 28 at 18:16
@Mark Plotnick Unfortunately, I can't seem to find much about the parent. It is what you would call, a custom application. I would not be able to get more information on my own.
â Timothy Pulliam
Aug 28 at 18:19
I'd be more worried about why the zombie processes exist than trying to reap them outside of the parent process. Are they zombies themselves causing any harm?
â Christian Gibbons
Aug 28 at 18:24
@ChristianGibbons The system seems pretty slow to respond. Probably related. I am just worried that left to themselves, the system will crash. There are no signs of stopping.
â Timothy Pulliam
Aug 28 at 18:30
2
Zombie processes only occupy space in the process table, they wouldnâÂÂt explain unresponsiveness.
â Stephen Kitt
Aug 28 at 18:36