From 431a96c41c0c94f84f6abffb51aea4738df7e278 Mon Sep 17 00:00:00 2001 From: Florent Villard Date: Wed, 26 Apr 2006 08:23:23 +0000 Subject: sometimes killing the father is not enough to control log size, use kill group --- iurt2 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'iurt2') 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; -- cgit v1.2.1