Mailinglist Archive: opensuse-buildservice (295 mails)

< Previous Next >
[opensuse-buildservice] /srv/obs/ subdirs on different partitions
  • From: Michal Marek <mmarek@xxxxxxx>
  • Date: Tue, 27 Mar 2007 17:50:41 +0200
  • Message-id: <46093D51.7050506@xxxxxxx>
Hi,

it took me >1 hour to figure out what's wrong. The worker successfully
built the rpm, but it didn't show up in the :full directory and 'osc
log' still reported 'building'. The problem was that I created
/srv/obs/build as a symlink to a larger partition, but the repserver
didn't expect that and tried to link files fron .../build to .../jobs
and didn't abort when this didn't work.

See attached patch. In case the link() is just a performance
optimization (the code doesn't relly on the two files being links), it
would be a nice feature to fallback to File::Copy :) But aborting with a
meaningful error message is IMO sufficient.

Michal
Index: bs_repserver
===================================================================
--- bs_repserver        (revision 1521)
+++ bs_repserver        (working copy)
@@ -473,10 +473,10 @@
   $status->{'job'} = $job;
   writexml("$statusdir/.status", "$statusdir/status", $status, $BSXML::buildstatus);
   unlink("$jobsdir/$arch/$job:dir/status.xml");
-  link("$statusdir/status", "$jobsdir/$arch/$job:dir/status.xml");
+  link("$statusdir/status", "$jobsdir/$arch/$job:dir/status.xml") || die("link $statusdir/status $jobsdir/$arch/$job:dir/status.xml: $!\n");
   mkdir_p("$workersdir/building");
   unlink("$workersdir/building/$idlename");
-  link("$statusdir/status", "$workersdir/building/$idlename");
+  link("$statusdir/status", "$workersdir/building/$idlename") || die("link $statusdir/statusdir $workersdir/building/$idlename: $!\n");
   return 1;
 }
 
@@ -621,7 +621,7 @@
   writexml("$statusdir/.status", "$statusdir/status", $status, $BSXML::buildstatus);
   writestr("$jobsdir/$arch/$job:dir/finished", undef, '');
   mkdir_p("$eventdir/$arch");
-  link("$jobsdir/$arch/$job:dir/finished", "$eventdir/$arch/finished:$job");
+  link("$jobsdir/$arch/$job:dir/finished", "$eventdir/$arch/finished:$job") || die("link $jobsdir/$arch/$job:dir/finished $eventdir/$arch/finished:$job: $!\n");
   ping($arch);
   return $BSStdServer::return_ok;
 }
< Previous Next >
Follow Ups