提交后钩子以svn中的用户身份运行 [英] post-commit hook run as what user in svn
问题描述
在以SYSTEM身份运行的Windows机器上的Apache.
post-commit.bat应该使用什么用户名和密码?
Apache on a windows machine running as SYSTEM.
What user and password should be used for a post-commit.bat?
我正在尝试将内容复制到目录以在Web服务器上的开发人员版本上进行测试,但似乎无法正常工作.
I am trying to copy content to a directory for testing on a developer version on the webserver and don't seem to have it working.
推荐答案
钩子脚本将由服务器启动,因此您只需要确保相应的用户(您的系统名)具有
The hook scripts will be launched by the server, so you only need to make sure the corresponding user (SYSTEM for you) has
- 对存储库的读/写访问(应该已经是这种情况了)
- 读取/执行对钩子脚本的访问
取决于脚本的功能,您可能需要更多,例如,如果它创建了日志-如果它通常访问其他资源.这可能就是您遇到的问题.
Depending on what your script does, you may need more, for example if it creates a log - if it accesses other resources in general. That's probably the problem you have encountered.
此外,如果钩子脚本是.bat,则需要COMSPEC
环境变量来查找外壳(我在Windows XP中遇到此问题,这主要是由于配置错误).此变量通常定义为C:\Windows\system32\cmd.exe
. PATH
当然也很重要.
Also, if the hook script is a .bat, the COMSPEC
environment variable is needed to find the shell (I had this problem with Windows XP, it was mainly due to a bad configuration). This variable is typically defined as C:\Windows\system32\cmd.exe
. PATH
is also very important of course.
请注意,这可能会产生误导,当您使用其他用户登录名测试脚本时,您可能会再次访问您的服务器身份.
Note that it could be misleading, when you test the script with another user login you may have another access your server identity won't.
如果不确定服务器帐户中包含哪些重要环境变量,例如批处理脚本开头的PATH
和COMSPEC
,则可以设置或扩展这些变量. .例如,
It is possible to set or expand important environment variables like PATH
and COMSPEC
at the beginning of the batch script, if you are not sure what they contain with the server account. For example,
SET ComSpec=%SystemRoot%\system32\cmd.exe
SET PATH=%PATH%;C:\Tools\SVN\svn-win32-1.4.6\bin
有时候,比暗中尝试修改服务器帐户要容易得多.
Sometimes it is easier than being in the dark and trying to modify the server's account.
这篇关于提交后钩子以svn中的用户身份运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!