Thanks for the idea. I can see how that could work well, but I have over 300 sites and growing, that's just way to much overhead for the servers.
The final solution came, as most do, with a great deal of reading and learning yet another language (perl), and a lot of trial and error.
What I wound up with is:
- A 'listener', written in perl, and set up as a daemon that runs on all the servers.
- Each server has a shared directory that all the sites can write to.
-When a site requires a rebuild, it writes a text file called 'on' to the shared directory. The file contains a single line, which is the full path to the document root for the site.
- The listener is owned by root, and continuously checks the shared directory. When it finds a file named 'on', it reads the contents and sets the privilages of the site root to 777.
-the rebuild program waits for the privilages to be set, then rebuilds the site, then writes a file called 'off' to the shared directory
- the listener also looks for the 'off' files to set the site privilages back.
It's all working perfectly now.