iptables: remove the pid file after sending SIGTERM

Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
David Scott 2016-06-17 15:52:24 +01:00
parent 3c6ad76461
commit 12fbe114f6

View File

@ -65,7 +65,8 @@ let delete ({ proto; dport; ip; port } as p) =
let ic = open_in filename in
let pid = int_of_string (input_line ic) in
logf "Sending SIGTERM to %d" pid;
Unix.kill pid Sys.sigterm
Unix.kill pid Sys.sigterm;
Unix.unlink filename
with e ->
logf "delete: failed to remove proxy for %s: %s" filename (Printexc.to_string e);
()