Skip to content

Commit de0fdc2

Browse files
authored
CP/DP Split: handle kill signal (#3260)
Problem: The data plane container was not properly handling the kill signal when the Pod was Terminated. Solution: Update the entrypoint to catch the proper signals.
1 parent f2bc918 commit de0fdc2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

build/entrypoint.sh

+13
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,24 @@ handle_term() {
66
echo "received TERM signal"
77
echo "stopping nginx-agent ..."
88
kill -TERM "${agent_pid}" 2>/dev/null
9+
wait -n ${agent_pid}
910
echo "stopping nginx ..."
1011
kill -TERM "${nginx_pid}" 2>/dev/null
12+
wait -n ${nginx_pid}
13+
}
14+
15+
handle_quit() {
16+
echo "received QUIT signal"
17+
echo "stopping nginx-agent ..."
18+
kill -QUIT "${agent_pid}" 2>/dev/null
19+
wait -n ${agent_pid}
20+
echo "stopping nginx ..."
21+
kill -QUIT "${nginx_pid}" 2>/dev/null
22+
wait -n ${nginx_pid}
1123
}
1224

1325
trap 'handle_term' TERM
26+
trap 'handle_quit' QUIT
1427

1528
rm -rf /var/run/nginx/*.sock
1629

0 commit comments

Comments
 (0)