[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Weird export behaviour on Win2K in post-commit hook

From: Andreas Mahel <andreas.mahel_at_ch.ibm.com>
Date: 2004-04-15 11:44:30 CEST

To me this also looks like a permission problem. If your Apache is set up
default, then it will be running as the local "System" user, which will not
have any access to network shares (unless these shares are open for
everyone without authentication, which should not be done anyway). To
verify this, you might dump some environment information from your
post-commit batch file, like "set >> c:\temp\post-commit-env-dump.txt".

To overcome this restriction, you have (at least) 2 possibilities:
1.) If some user is logged in to the server console who has a mapping to
the network resource, then the System account might use this mapping (not
really elegant, but works as a start)
2.) You might want to have the Apache service run by a different (domain)
user (you can define that one in the computer management console ->
services...), who has the permissions to connect to the network share. To
be able to do so, the account used must have the privileges to run as a
service, though (I believe one can set that in the user management area /
AD mgmt console somewhere - haven't done it for some time).
And, of course, this user should have access to all the resources Apache
needs ...

hope this helps,

Andreas
_
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  Andreas Mahel
  IBM Global Services
  Telephone: +41 79 460 11 80
  E-Mail: Andreas.Mahel@ch.ibm.com
  Timezone: Switzerland GMT+1
  Visit Unity Software Deployment at: http://www.unitysite.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

                                                                           
             tom@opgenorth.net
             Sent by:
             topgenorth@interb To
             aun.com users@subversion.tigris.org
                                                                        cc
                                                                           
             15.04.2004 00:03 Subject
                                       Weird export behaviour on Win2K in
                                       post-commit hook
             Please respond to
                    tom
                                                                           
                                                                           
                                                                           
                                                                           

I've encountered a weird problem, and while I think it is
probably more Windows related than an issue with Subversion,
I figured I would ask here. What my client wants is
something very similar to the shadow directory concept in
Visual Source Safe: When a file is checked in, a copy of
that file is pushed out to a directory on a disk somewhere.
This is for access to the file by non-technical users who
are used to just copying the file from somewhere. I figured
that this would be easy enough to emulate with Subversion
using a post-commit hook.

I wrote a little program in C# that is called by
post-commit.bat, and will svnlook at the commit and see if
any directories of interest have been modified. If they
have, then the directory will be exported to a drive on the
network (using svn export). I control which directories are
watched and where they are supposed to be exported to by the
applications .config file.

So in short, I've basically got a little post-commit hook
that does this:

Find out what files have changed in the commit -
svnlook changed C:/svnrepo 200

Check output, find out what directories have changed. For
each target directory that has changed export it -
svn export --username user --password passwd --force -r
http://123.45.67.890:8080/svn/trunk/Model
R:/Fcs/Model/Operational

The Subversion server (v1.0.1) is running on a Win2K Pro
box, using Apache 2.0.49 for client access. On each commit,
files are supposed to be exported to a directory on the
network. Thanks to log4net, what I see happening is that
the application is successfully retrieving a list of changed
files via svnlook changed.

Now when the application tries to use svn export to export
the directory to the network drive, nothing happens. If I
tweak my .config file to have the directory to a local
drive, then the export works.

Oddly enough, if I run my program from the command-line,
passing it the values it would get from post-commit.bat, it
works. Just something odd about when the Subversion server
tries to do things that is causing it to not work properly.

Any suggestion/tips/advice? I appreciate any help I get.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Apr 15 11:51:03 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.