Signer: remove socket on all more termination signals

This commit is contained in:
Vincent Bernardoff 2018-11-01 23:07:17 +01:00 committed by Benjamin Canou
parent d1c46b5cf2
commit 56fa339937

View File

@ -65,11 +65,13 @@ let run (cctxt : #Client_context.wallet) path ?magic_bytes ~check_high_watermark
-% s host_name host
-% s service_name service)
| Unix path ->
Sys.set_signal Sys.sigint (Signal_handle begin fun _ ->
List.iter begin fun signal ->
Sys.set_signal signal (Signal_handle begin fun _ ->
Format.printf "Removing the local socket file and quitting.@." ;
Unix.unlink path ;
exit 0
end) ;
end)
end Sys.[sigint ; sigterm] ;
log Tag.DSL.(fun f ->
f "Accepting UNIX requests on %s"
-% t event "accepting_unix_requests"