diff options
author | Pascal Terjan <pterjan@mageia.org> | 2012-03-05 20:27:05 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2012-03-05 20:27:05 +0000 |
commit | 5f4056722f237fb55da3cdc47fbfb045ad480170 (patch) | |
tree | c6810d04e68cdf469b196413bdfc5481bfeaad0f | |
parent | 6f0279ed078b986e971086b69a22624ad43457e5 (diff) | |
download | iurt-5f4056722f237fb55da3cdc47fbfb045ad480170.tar iurt-5f4056722f237fb55da3cdc47fbfb045ad480170.tar.gz iurt-5f4056722f237fb55da3cdc47fbfb045ad480170.tar.bz2 iurt-5f4056722f237fb55da3cdc47fbfb045ad480170.tar.xz iurt-5f4056722f237fb55da3cdc47fbfb045ad480170.zip |
Fork to wait for the build to finish, then immediately collect results
-rwxr-xr-x | ulri | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -715,7 +715,21 @@ foreach my $prefix (sort keys %pkg_tree) { "$lock_arch.$bot.$host.$fulldate.$pid.lock"; plog('DEBUG', "create lock $lock_file"); create_file($lock_file, "$program_name $$", time()); - + + # Fork to wait for the build to finish + if ((my $fpid = fork()) == 0) { + local $SIG{ALRM} = sub { + # Run ourselves to kill the build + exec "ulri"; + }; + alarm $config->{faildelay}; + # SSH to $host and wait up for $pid to exit + ssh($remote, "'while /bin/true; do ps $pid >/dev/null 2>&1 || exit; sleep 1; done'"); + alarm 0; + # Fetch build results + exec "ulri"; + } + last; } last if $compildone->{$prefix}{$media}{$arch}; |