On Sat, Jul 14, 2007 at 03:52:56AM -0400, Richard Lowe wrote: > Bill Sommerfeld <sommerfeld at sun.com> writes: > > > The build taskid should wind up in a file somewhere accessible before > > nightly starts anything time-consuming like make clobber or bringover; > > the cleanest way to kill a mistakenly-started build is with pkill -T -- > > though maybe the way to do this is by putting the taskid into the lock > > file.. > > I'd like to do both, actually, since yes, that's how I kill them off > too, and pkill -T $(<lockfile) is so much more pleasant.
Before you go mucking with what gets stuck in the lockfile and all attached to reading its contents, the lockfile race needs to be fixed. I see this in the incremental builds reasonably frequently, when my home directory goes down, and a dozen or so nightlies get fired up by cron at roughly the same time on the same env file. They'll all actually try to do something. The lock needs to be something that's created atomically. My nightly mod makes it a symlink, and puts the lock data into the symlink, though it could be a directory with files inside (which makes it easier in some ways and harder in some ways to deal with). I can donate my code if you like. Danek