diff options
author | Florent Villard <warly@mandriva.com> | 2006-04-26 08:23:23 +0000 |
---|---|---|
committer | Florent Villard <warly@mandriva.com> | 2006-04-26 08:23:23 +0000 |
commit | 431a96c41c0c94f84f6abffb51aea4738df7e278 (patch) | |
tree | 15b9402eeb44464f3bf35ac58785addf005ebf84 | |
parent | 18e3fd016d46b5b200f81a012b7829d101e85bc6 (diff) | |
download | iurt-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-x | iurt2 | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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; |