RE: health check passthrough not 100% in combination with haproxy
3 Nov
2021
3 Nov
'21
9:26 p.m.
I was not having the exit trap and the sleep+kill, I don't really get why it is necessary to have these. Looks a bit inefficient to me having a sleep and to kill your own process. But I am not really a bash expert.
which of course does not make sense... can you try if this works? I'm guessing your script probably looks pretty much like this already...
#!/bin/bash timeout=10 trap "exit 0" QUIT { sleep $timeout kill -3 $$ 2>/dev/null } & read -r input exit_code=$? if [ ${exit_code} -eq 0 ]; then echo -n -e "HTTP/1.1 200 OK\r\n" echo -n -e "Content-Length: 0\r\n" echo -n -e "\r\n" fi exit 0
1114
Age (days ago)
1114
Last active (days ago)
0 comments
1 participants
participants (1)
-
Marc