Denis Vlasenko | 4e19a9c | 2008-07-26 13:45:57 +0000 | [diff] [blame] | 1 | #!/bin/sh |
2 | |||||
3 | $THIS_SH -c ' | ||||
4 | cleanup() { | ||||
5 | echo "child exits as expected" | ||||
6 | exit | ||||
7 | } | ||||
8 | trap cleanup HUP | ||||
Denis Vlasenko | 8dbea7d | 2008-07-26 14:20:04 +0000 | [diff] [blame] | 9 | echo "child sleeps" |
Denis Vlasenko | 4e19a9c | 2008-07-26 13:45:57 +0000 | [diff] [blame] | 10 | sleep 1 |
11 | echo "BAD exit from child!" | ||||
12 | ' & | ||||
13 | |||||
14 | child=$! | ||||
15 | sleep 0.1 # let child install handler first | ||||
16 | kill -HUP $child | ||||
17 | wait | ||||
18 | echo "parent exits" |