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/Chroot.pm | 3 +++ lib/Iurt/Process.pm | 6 ++++-- lib/Iurt/Urpmi.pm | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index b0d48cc..53649ac 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -439,6 +439,7 @@ sub create_chroot { plog("rebuild chroot tarball"); $rebuild = 1; if (!build_chroot($run, $config, $tmp_chroot, $chroot_tar, $opt)) { + plog('NOTIFY', "creating chroot failed."); $clean->(); sudo($run, $config, '--rm', '-r', $chroot, $chroot_tar); return; @@ -461,6 +462,7 @@ sub create_chroot { sudo($run, $config, '--rm', '-r', $tmp_chroot); mkdir $tmp_chroot; if (!build_chroot($run, $config, $tmp_chroot, $chroot_tar, $opt)) { + plog('NOTIFY', "creating chroot failed."); $clean->(); return; } @@ -472,6 +474,7 @@ sub create_chroot { plog('ERR', "can't check chroot, recreating"); if (!build_chroot($run, $config, $tmp_chroot, $chroot_tar, $opt)) { + plog('NOTIFY', "creating chroot failed."); $clean->(); return; } 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 diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm index 563a879..4de91b4 100644 --- a/lib/Iurt/Urpmi.pm +++ b/lib/Iurt/Urpmi.pm @@ -455,7 +455,11 @@ sub install_packages { # returning false problem on deps installation, try # to compile anyway - @missing_deps or return 1; + if (!@missing_deps){ + plog ('DEBUG', 'missing_deps is empty, aborting.'); + plog ('DEBUG', "output had: __ $output __"); + return 1; + } $unsatisfied = 1; while (my $missing_package = shift @missing_deps) { @@ -492,6 +496,7 @@ sub install_packages { 0; }, )) { + plog ('DEBUG', "urpmi command failed."); if (!clean_process($run, "$self->{urpmi_command} $opt @to_install", $run->{verbose})) { dump_cache_par($run); die "FATAL $program_name: Could not have urpmi working !"; -- cgit v1.2.1