aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2012-03-05 20:27:05 +0000
committerPascal Terjan <pterjan@mageia.org>2012-03-05 20:27:05 +0000
commit5f4056722f237fb55da3cdc47fbfb045ad480170 (patch)
treec6810d04e68cdf469b196413bdfc5481bfeaad0f
parent6f0279ed078b986e971086b69a22624ad43457e5 (diff)
downloadiurt-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-xulri16
1 files changed, 15 insertions, 1 deletions
diff --git a/ulri b/ulri
index f4467bf..b9a35f7 100755
--- a/ulri
+++ b/ulri
@@ -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};