[NCLUG] CVS Auto update of web pages?

Sean Reifschneider jafo-nclug at tummy.com
Wed Apr 3 23:38:18 MST 2002


On Wed, Apr 03, 2002 at 08:43:57PM +0100, Matthew Wilcox wrote:
>That's "willy", dude :-)

Sorry...

>My implementation sent an email to the webserver user which upon receipt
>took a local lock, ran cvs up, ran make, slept for 180 seconds and
>released the lock.

Doesn't that mean that if you have two commits done in less than 3 minutes,
only the first will actually be done?

I'd think you'd want to:

   get lock
   sleep 180
   drop lock
   do update

That should reduce the possibility of the lock keeping a legitimate update
from occuring while still addressing your DoS fears.

Or perhaps set up a pair of locks, one for the process as a whole, and one
for the build:

   function doUpdate:
      get make lock
      do update
      release make lock

   get main lock
   doUpdate()
   sleep 180
   release main lock
   doUpdate()

Sean
-- 
 George Washington was first in war, first in peace -- and first to
 have his birthday juggled to make a long weekend.
Sean Reifschneider, Inimitably Superfluous <jafo at tummy.com>
tummy.com - Linux Consulting since 1995. Qmail, KRUD, Firewalls, Python



More information about the NCLUG mailing list