From 3f28445fdfa9a063db48a022a100b365429d666f Mon Sep 17 00:00:00 2001 From: Marcelo Leitner Date: Mon, 12 Nov 2007 09:36:39 +0000 Subject: - Put some more debugging into command execution process. - Lowered free disk space tolerance from 100% to 99%, as 100% could be too late. --- lib/Iurt/Process.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/Iurt/Process.pm') diff --git a/lib/Iurt/Process.pm b/lib/Iurt/Process.pm index 6982a65..ca649b7 100644 --- a/lib/Iurt/Process.pm +++ b/lib/Iurt/Process.pm @@ -104,7 +104,7 @@ sub perform_command { $opt{freq} ||= 24; $opt{type} ||= 'shell'; - plog('DEBUG', "Timeout $opt{timeout}"); + plog('DEBUG', "Using timeout of $opt{timeout} seconds."); my ($output, $fulloutput, $comment); my ($kill, $pipe); @@ -154,7 +154,7 @@ sub perform_command { exit(); } my $df = df $opt{log}; - if ($df->{per} == 100) { + if ($df->{per} >= 99) { plog('WARN', "WARNING: killing current command because running out of disk space (only $df->{bavail}KB left)"); kill 14, "-$parent_pid"; exit(); @@ -190,6 +190,8 @@ sub perform_command { }; $err = $?; + # Log it before any changes on it. + plog ('DEBUG', "Command exited with $err."); $err = 0 if any { $_ == $err } @{$opt{error_ok}}; # kill pid watching log file size -- cgit v1.2.1