Fixed container restart

This commit is contained in:
2024-05-13 21:43:21 +02:00
parent 987aaa65a7
commit faae225d96
7 changed files with 78 additions and 13 deletions
Executable
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
trap_with_arg() {
func="$1" ; shift
for sig ; do
echo "$func $sig"
trap "$func $sig" "$sig"
done
}
func_trap() {
echo "Trapped: $1"
echo "Killing ${PID}"
kill -9 -${PID}
}
trap_with_arg func_trap EXIT TERM HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM
./parent.sh &
PID=$$
echo "Pid = $PID"
sleep 10