Killing Child "su" process also kills parent
CentOS 6.6
I have a simple script parent.sh Code:
#!/bin/bash When the script was running (and sleeping), if the su command was killed, parent.sh is also killed, such that the "Waked up" message was not displayed. Why killing a child affect the parent? Sample transcript: On session 1 (parent.sh running and sleeping): Code:
[root@mylinux ~]# ./parent.sh Code:
[root@mylinux ~]# ps -ef|grep sleep In session 1, parent.sh is also killed. Complete message: Code:
[root@mylinux ~]# ./parent.sh Note: 1. if sleep is not run with su (i.e., use the commented out sleep), or I kill the actual sleep command instead of su command (6783 in above sample), parent.sh is not killed. 2. I forgot what I did, but in attempts to pinpoint the issue, I got message like "terminated 143", where exit code 143 probably means program killed by SIGTERM |
Resolved by upgrade coreutils to 8.4-37.el6 (CentOS 6.5 original version: 8.4-31.el6).
It is CentOS 6.5 instead of 6.6 :P |
All times are GMT -5. The time now is 05:45 PM. |