diff options
-rwxr-xr-x | iurt2 | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -183,7 +183,7 @@ if (-f $configfile) { } else { $config = {} } -my $urpmi_options = "-v --no-verify-rpm --nolock --auto"; +my $urpmi_options = "-v --no-verify-rpm --nolock --auto --ignoresize"; if ($run{use_system_distrib}) { $config->{basesystem_media_root} ||= $run{use_system_distrib} } else { @@ -496,10 +496,12 @@ retry: print {$run{LOG}} "iurt: calling callback for $opt->{hash}\n" if $run{debug}; if ($unionfs_tmp && $output =~ /no space left on device/i) { print {$run{LOG}} "ERROR iurt: running out of space to compile $srpm in unionfs mode, will recompile it in normal mode\n"; - $cache->{no_unionfs}{$srpm} = 1 + $cache->{no_unionfs}{$srpm} = 1; + return 1 } elsif ($unionfs_tmp && $output =~ m,$home,) { print {$run{LOG}} "ERROR iurt: seems like building $srpm needs to access /proc/self/exe, which is broken with unionfs, will try to recompile it in non unionfs mode\n"; - $cache->{no_unionfs}{$srpm} = 1 + $cache->{no_unionfs}{$srpm} = 1; + return 1 } }, freq => 1) && !glob "$chroot/home/builder/rpm/RPMS/*/*.rpm") { @@ -566,9 +568,9 @@ if (open my $file, ">$local_spool/log/wrong_srpm_names.log") { } } -if ($config->{rsync_to} && !$run{no_rsync}) { +if ($config->{rsync_to} && !$run{no_rsync}) { # remove some old and very big log files not to saturate the server - system(qq|find $local_spool/log/ -name "*.log" \( -size +$config->{log_size_limit} -or -mtime +$config->{log_size_date} \) -exec rm -f {} \;|); + system(qq|find $local_spool/log/ -name "*.log" \\( -size +$config->{log_size_limit} -or -mtime +$config->{log_size_date} \\) -exec rm -f {} \\;|); system("rsync --delete -alHPe 'ssh -c arcfour' $local_spool/log/ $config->{rsync_to}/$run{distro_tag}/$run{my_arch}/log/"); } @@ -865,21 +867,22 @@ sub perform_command { $pid = fork; my $tot_time; if (!$pid) { + print {$run{LOG}} "Forking to monitor log size\n" if $run{verbose} > 2; $run->{main} = 0; local $SIG{ALRM} = sub { exit }; - $tot_time += sleep 60; + $tot_time += sleep 30; my $size_limit = $config->{log_size_limit}; $size_limit =~ s/k/000/i; $size_limit =~ s/M/000000/i; $size_limit =~ s/G/000000000/i; while ($tot_time < $opt{timeout}) { - $tot_time += sleep 60; my (@stat) = stat $logfile; if ($stat[7] > $size_limit) { - print {$run{LOG}} "WARNING: killing current command because of log size exceeding limit ($size_limit > $config->{log_size_limit})\n"; + print {$run{LOG}} "WARNING: killing current command because of log size exceeding limit ($stat[7] > $config->{log_size_limit})\n"; kill 14, $parent_pid; exit } + $tot_time += sleep 30; } exit } @@ -913,7 +916,7 @@ sub perform_command { $output = <$log> } if (ref $opt{callback}) { - $opt{callback}(\%opt, $output) + $opt{callback}(\%opt, $output) and return } if ($kill) { $output = "Command has been killed after $opt{timeout} seconds: $command\n$output" @@ -933,7 +936,7 @@ sub perform_command { } return 0 } - if ($err || $opt{error_regexp} && $output =~ /$opt{error_regexp}/) { + if ($kill || $err || $opt{error_regexp} && $output =~ /$opt{error_regexp}/) { if ($opt{mail} && $config->{sendmail} && !$config->{no_mail}{$opt{mail}}) { if (! ($cache->{warning}{$opt{hash}}{$opt{mail}} % $opt{freq})) { my $cc = join ',', grep { !$config->{no_mail}{$_} } split ',', $opt{cc}; |