From 56b31becb23e2ab6d687e00bd509c05cafeebdd1 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 4 Oct 2018 10:47:38 -0400 Subject: [PATCH] Add explicit db disconnect in Fatal(). If we don't disconnect then we leave sockets hanging around in TIME_WAIT (I think). --- scripts/ZoneMinder/lib/ZoneMinder/Logger.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm index 16535d9e3..3caa6af4a 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm @@ -704,6 +704,8 @@ sub Fatal( @ ) { if ( $SIG{TERM} and ( $SIG{TERM} ne 'DEFAULT' ) ) { $SIG{TERM}(); } + # I think if we don't disconnect we will leave sockets around in TIME_WAIT + zmDbDisconnect(); exit(-1); }