Hi,
We are using -p option to save the pid of HAProxy. When a new HAProxy is
received, we use -st pid option to reload HAProxy.
The issue we are having is that -st option sometimes does not kill the
old process.
An example would be:
root 372 1 0 03:22 ? 00:00:00 haproxy -p
/tmp/haproxy_pid -f /conf/haproxy.conf
root 513 1 0 03:22 ? 00:00:00 haproxy -p
/tmp/haproxy_pid -f /conf/haproxy.conf -st 372
Doing a strace shows that:
unlink("/tmp/haproxy_pid") = 0
open("/tmp/haproxy_pid", O_WRONLY|O_CREAT|O_TRUNC, 0644) = 8
kill(372, SIGTERM) = 0
getrlimit(RLIMIT_NOFILE, {rlim_cur=1036, rlim_max=1036}) = 0
clone(child_stack=0,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0x7f04f5bf2a90) = 514
write(8, "514\n", 4) = 4
close(8) = 0
exit_group(0) = ?
+++ exited with 0 +++
So kill(372, SIGTERM) was successful, however the process is still hanging.
Doing strace -p shows that:
[root@seescheese /]# strace -p 372
Process 372 attached
gettimeofday({1458265436, 272452}, NULL) = 0
gettimeofday({1458265436, 272563}, NULL) = 0
epoll_wait(0, {}, 200, 1000) = 0
gettimeofday({1458265437, 274149}, NULL) = 0
gettimeofday({1458265437, 274222}, NULL) = 0
epoll_wait(0, {}, 200, 1000) = 0
...
Thanks in advance.
Best,
Bowen