From 6a3ab327ca2785894add277af69dbbece86490ea Mon Sep 17 00:00:00 2001 From: stan Date: Fri, 5 Dec 2008 21:13:19 +0000 Subject: [PATCH] Changed process exit string to look les like crashes when things get restarted and sleeps interrupted. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2701 e3e1d417-86f3-4887-817a-d78f3d33393f --- scripts/zmdc.pl | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/scripts/zmdc.pl b/scripts/zmdc.pl index f053137eb..c2a705e96 100644 --- a/scripts/zmdc.pl +++ b/scripts/zmdc.pl @@ -543,9 +543,30 @@ if ( !$server_up ) my $core_dumped = $status&0x01; my $out_str = "'$process->{daemon} ".join( ' ', @{$process->{args}} )."' "; - $out_str .= $exit_signal?"crashed":("exited ".(($exit_status==0)?"normally":"abnormally")); - $out_str .= ", exit status $exit_status" if ( $exit_status ); - $out_str .= ", signal $exit_signal" if ( $exit_signal ); + if ( $exit_signal ) + { + if ( $exit_signal == 15 || $exit_signal == 14 ) # TERM or ALRM + { + $out_str .= "exited"; + } + else + { + $out_str .= "crashed"; + } + $out_str .= ", signal $exit_signal"; + } + else + { + $out_str .= "exited "; + if ( $exit_status ) + { + $out_str .= "abnormally, exit status $exit_status"; + } + else + { + $out_str .= "normally"; + } + } #print( ", core dumped" ) if ( $core_dumped ); $out_str .= "\n";