aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorent Villard <warly@mandriva.com>2006-04-26 08:23:23 +0000
committerFlorent Villard <warly@mandriva.com>2006-04-26 08:23:23 +0000
commit431a96c41c0c94f84f6abffb51aea4738df7e278 (patch)
tree15b9402eeb44464f3bf35ac58785addf005ebf84
parent18e3fd016d46b5b200f81a012b7829d101e85bc6 (diff)
downloadiurt-431a96c41c0c94f84f6abffb51aea4738df7e278.tar
iurt-431a96c41c0c94f84f6abffb51aea4738df7e278.tar.gz
iurt-431a96c41c0c94f84f6abffb51aea4738df7e278.tar.bz2
iurt-431a96c41c0c94f84f6abffb51aea4738df7e278.tar.xz
iurt-431a96c41c0c94f84f6abffb51aea4738df7e278.zip
sometimes killing the father is not enough to control log size, use kill group
-rwxr-xr-xiurt210
1 files changed, 7 insertions, 3 deletions
diff --git a/iurt2 b/iurt2
index d058595..c7ea699 100755
--- a/iurt2
+++ b/iurt2
@@ -321,8 +321,12 @@ if (!-d "$config->{local_upload}/iurt/$run{distro_tag}/") {
mkdir "$local_spool/log"
}
}
-# perform some cleaning before running to have some more space
-system(qq|find $local_spool/log/ -name "*.log" \\( -size +$config->{log_size_limit} -or -mtime +$config->{log_size_date} \\) -exec rm -f {} \\;|);
+# perform some cleaning before running to have some more space, rsync to the server too in case previous iurt crashed
+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("rsync --delete -alHPe 'ssh -c arcfour' $local_spool/log/ $config->{rsync_to}/$run{distro_tag}/$run{my_arch}/log/");
+}
if (!dump_rpmmacros("$chroot/home/builder/.rpmmacros")) {
print "ERROR iurt: could not dump rpm macros to $chroot/home/builder/.rpmmacros, trying to rebuild the chroot";
@@ -933,7 +937,7 @@ sub perform_command {
my (@stat) = stat $logfile;
if ($stat[7] > $size_limit) {
print {$run{LOG}} "WARNING: killing current command because of log size exceeding limit ($stat[7] > $config->{log_size_limit})\n";
- kill 14, $parent_pid;
+ kill 14, "-$parent_pid";
exit
}
$tot_time += sleep 30;