[cvsnt] trying to shadow website on network drive

Misner, Ris rmisner at accelent.com
Tue Aug 12 21:05:19 BST 2003


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


Hi,

I've got a tricky problem with my CVS repository and I need help.  I am trying to configure the CVS server to keep a certain directory up-to-date with the HEAD of the CVS repository.  I have written a python script to do this and I have set up my postcommit file to launch the python script at the right times and it works as long as the directory to update is on a local drive.

To explain further... CVSNT passes my script the directory where the commit took place and the directory where to create the shadow/mirror of the repository.  The script calculates a result path and changes directories to the target shadow directory where the script executes "cvs -q update -l" which captures the fresh change from the repository into my shadow directory.

One of the projects in this repository is the company website, so the idea is that developers will commit a change to the website in CVS, and then this postcommit script will automatically update the website directory on the server so that the change appears on the internet immediately after that change is committed to CVS.  This would be very convenient integration if I could get it working.

Unfortunately, my system is not working for the website though it works for other modules in the repository.  Here's the problem... There are two servers on the network and I am having trouble making the one machine visible to the other through CVS.  Machine A runs the web server service and hosts the website files while machine B runs CVS.  I created a mapped network drive on machine B so that its W: drive would point to the \\A\wwwroot directory which is where I want to run my updates.  However, when CVS runs my script, my script says that W: is an unknown file or directory.  I assume that's because the W: drive is mapped only for the user "administrator" and when the python script is executed by CVSNT, python runs as a different user who does not have a W: drive (for example SYSTEM though I'm not sure exactly what the profile is that is used for the CVSNT-launched processes like this).

So my mapped drive plan fails because I can't find a way to map a drive that is visible to the CVSNT service.

So I tried using UNC paths.  In Python, I change directories to "\\a\wwwroot" instead of "W:\" but when I execute the python command: os.system("cvs.exe update"), I get the error "CMD.EXE UNC paths are unsupported" because it won't allow being executed from a UNC path.

So I tried specifying the path to update in the cvs.exe command line instead of from the working directory, as in:

cvs.exe -d:pserver:username:password update "W:\"

but I get an error from the server that absolute paths are not supported.  I can't figure out why though.  Every other CVS repository I have ever used allowed me to specify a directory of file name in a cvs update command, but I always get the server error message that absolute paths are not supported, no matter what path I try to update.

When I try the same thing as
cvs.exe -d:pserver:username:password update "\\B\wwwroot"

I get the error: "\\B\wwwroot" does not exist.  It does exist, but not in a cmd.exe command shell apparently.

So I thought I would try to configure it to run my script using the windows built-in executable RunAs.exe.  I thought if I could run my script as "administrator" then it would get the W: drive mapping and work as desired.  But RunAs requires you to manually enter a password when prompted, so it doesn't work in an automation sense.

So I thought I would try changing the CVSNT service to run as administrator so it would inherit the W: drive mapping, but when I tried that and tried to commit a change, I got an error message saying the CVSNT did not have adequate permission to process the commit and I couldn't figure out what permissions to add to the administrator account to allow administrator to run CVSNT.

So anyway, there seem to be a wide variety of potential solutions to my problem, including but not limited to the following:

1) make W: drive mapping available to all users on machine B so that CVSNT service see it so that processes it launches will also see it

2) grant administrator account adequant permissions to run the CVSNT service and change the service properties to run as administrator instead of running as LocalHost

3) enable cvsnt service to see UNC paths

4) find a way to map a network drive programmatically in python or from a DOS command line that I could do on startup of the machine or in a batch file that executes by shadow directory script

Or I'm open to other possible solutions.  Has anyone done anything like this before?  What can I do?  If I want this to work am I going to be forced to host the website files and run CVS from the same machine?  Or do I have to set up some kind of home-made service on machine A (the website host) to answer messages from machine B (the CVS server) in order to cause machine A to launch the cvs update?  It seems like there has to be a better way than that at least...

-Ris


More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook