killing parent process doesn't kill child
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have a question.
Studying processes management I observed a strange behavior, on a CentOS 7.
I know that killing a parent process, the child processes are killed also. But not in the following case. I ran the command dd, just for example:
[root@server2 ~]# dd if=/dev/zero of=/dev/null &
[1] 1756
[root@server2 ~]# ps fax | grep -B2 dd
1737 pts/2 S 0:00 _ su -
1741 pts/2 S 0:00 _ -bash
1756 pts/2 R 1:18 _ dd if=/dev/zero of=/dev/null
After that I tried to kill (with SIGKILL signal) the parent process, that is the bash, but this action doesn't kill the dd process:
[root@server2 ~]# kill -9 1741
Killed
[user@server2 ~]#
The shell terminates but as you can see in the top command output, the dd process is still working:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1756 root 20 0 107948 612 512 R 99.9 0.1 10:06.98 dd
Do you have any idea about it please? Thanks
process kill
add a comment |Â
up vote
1
down vote
favorite
I have a question.
Studying processes management I observed a strange behavior, on a CentOS 7.
I know that killing a parent process, the child processes are killed also. But not in the following case. I ran the command dd, just for example:
[root@server2 ~]# dd if=/dev/zero of=/dev/null &
[1] 1756
[root@server2 ~]# ps fax | grep -B2 dd
1737 pts/2 S 0:00 _ su -
1741 pts/2 S 0:00 _ -bash
1756 pts/2 R 1:18 _ dd if=/dev/zero of=/dev/null
After that I tried to kill (with SIGKILL signal) the parent process, that is the bash, but this action doesn't kill the dd process:
[root@server2 ~]# kill -9 1741
Killed
[user@server2 ~]#
The shell terminates but as you can see in the top command output, the dd process is still working:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1756 root 20 0 107948 612 512 R 99.9 0.1 10:06.98 dd
Do you have any idea about it please? Thanks
process kill
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a question.
Studying processes management I observed a strange behavior, on a CentOS 7.
I know that killing a parent process, the child processes are killed also. But not in the following case. I ran the command dd, just for example:
[root@server2 ~]# dd if=/dev/zero of=/dev/null &
[1] 1756
[root@server2 ~]# ps fax | grep -B2 dd
1737 pts/2 S 0:00 _ su -
1741 pts/2 S 0:00 _ -bash
1756 pts/2 R 1:18 _ dd if=/dev/zero of=/dev/null
After that I tried to kill (with SIGKILL signal) the parent process, that is the bash, but this action doesn't kill the dd process:
[root@server2 ~]# kill -9 1741
Killed
[user@server2 ~]#
The shell terminates but as you can see in the top command output, the dd process is still working:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1756 root 20 0 107948 612 512 R 99.9 0.1 10:06.98 dd
Do you have any idea about it please? Thanks
process kill
I have a question.
Studying processes management I observed a strange behavior, on a CentOS 7.
I know that killing a parent process, the child processes are killed also. But not in the following case. I ran the command dd, just for example:
[root@server2 ~]# dd if=/dev/zero of=/dev/null &
[1] 1756
[root@server2 ~]# ps fax | grep -B2 dd
1737 pts/2 S 0:00 _ su -
1741 pts/2 S 0:00 _ -bash
1756 pts/2 R 1:18 _ dd if=/dev/zero of=/dev/null
After that I tried to kill (with SIGKILL signal) the parent process, that is the bash, but this action doesn't kill the dd process:
[root@server2 ~]# kill -9 1741
Killed
[user@server2 ~]#
The shell terminates but as you can see in the top command output, the dd process is still working:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1756 root 20 0 107948 612 512 R 99.9 0.1 10:06.98 dd
Do you have any idea about it please? Thanks
process kill
asked Apr 29 at 7:51
intore
746
746
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
By default killing a parent process does not kill the children processes.
I suggest you look for other questions about how to kill both the parent and child using the process group (a negative PID).
A good answer about how to do this in detail can be found at Process descendants
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
By default killing a parent process does not kill the children processes.
I suggest you look for other questions about how to kill both the parent and child using the process group (a negative PID).
A good answer about how to do this in detail can be found at Process descendants
add a comment |Â
up vote
3
down vote
accepted
By default killing a parent process does not kill the children processes.
I suggest you look for other questions about how to kill both the parent and child using the process group (a negative PID).
A good answer about how to do this in detail can be found at Process descendants
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
By default killing a parent process does not kill the children processes.
I suggest you look for other questions about how to kill both the parent and child using the process group (a negative PID).
A good answer about how to do this in detail can be found at Process descendants
By default killing a parent process does not kill the children processes.
I suggest you look for other questions about how to kill both the parent and child using the process group (a negative PID).
A good answer about how to do this in detail can be found at Process descendants
answered Apr 29 at 9:38
Craig Small
47626
47626
add a comment |Â
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%2f440691%2fkilling-parent-process-doesnt-kill-child%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