diff options
author | Florent Villard <warly@mandriva.com> | 2006-04-26 09:02:55 +0000 |
---|---|---|
committer | Florent Villard <warly@mandriva.com> | 2006-04-26 09:02:55 +0000 |
commit | fb07450658d9a95caa5e980c0490adc22984a293 (patch) | |
tree | 1a13f6c751255c900512797a20b7bd04f221a9b2 /iurt2 | |
parent | 431a96c41c0c94f84f6abffb51aea4738df7e278 (diff) | |
download | iurt-fb07450658d9a95caa5e980c0490adc22984a293.tar iurt-fb07450658d9a95caa5e980c0490adc22984a293.tar.gz iurt-fb07450658d9a95caa5e980c0490adc22984a293.tar.bz2 iurt-fb07450658d9a95caa5e980c0490adc22984a293.tar.xz iurt-fb07450658d9a95caa5e980c0490adc22984a293.zip |
Check filesystem free space too and stop if full
Diffstat (limited to 'iurt2')
-rwxr-xr-x | iurt2 | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -36,6 +36,7 @@ use File::NCopy qw(copy); use MIME::Words qw(encode_mimewords); use Fcntl ':flock'; use Mkcd::Commandline qw(parseCommandLine usage); +use Filesys::Df qw(df); my $program_name = 'iurt2'; # sessing parameters @@ -377,6 +378,12 @@ my $home = $config->{local_home}; my $union_id = 1; my $unionfs_tmp = $run{unionfs}; my $chroot_tmp = "$chroot.$run{run}"; + +my $df = df $home; +if ($df->{per} == 100) { + die "FATAL iurt: not enough space on the filesystem, only $df->{bavail}KB on $home, full at $df->{per}%" +} + foreach (my $i ; $i < @{$run{todo}}; $i++) { my ($dir, $srpm) = @{$run{todo}[$i]}; $done{$srpm} and next; @@ -940,6 +947,12 @@ sub perform_command { kill 14, "-$parent_pid"; exit } + my $df = df $opt{log} ; + if ($df->{per} == 100) { + print {$run{LOG}} "WARNING: killing current command because running out of disk space (only $df->{bavail}KB left)\n"; + kill 14, "-$parent_pid"; + exit + } $tot_time += sleep 30; } exit |