简体   繁体   English

通过CIF进行颠覆不起作用

[英]subversion via cifs is not working

I am trying to use subversion on a linux machine, the repository is on a Microsoft sbs2008 server. 我试图在Linux机器上使用Subversion,存储库位于Microsoft sbs2008服务器上。 (I can access the repository from a Microsoft Windows 7 machine.) Can some one tell me how to get it to work? (我可以从Microsoft Windows 7计算机访问存储库。)有人可以告诉我如何使其工作吗?

This is what I have done. 这就是我所做的。

# sudo mount -t cifs -v -o credentials=~/Files/server-mount-credentials,uid=richard,nocase,nounix,nosuid  //sbs2008/local ~/Files/server-mount/

# svn commit -m ""

Adding         file1
Sending        file2
Transmitting file data ........svn: Commit failed (details follow):
svn: database is locked

The strace shows: strace显示:

open("/home/rdelorenzi/Files/server-mount/svn_repository/db/rep-cache.db", O_RDWR|O_CREAT|O_LARGEFILE, 0644) = 12

...

_llseek(12, 162816, [162816], SEEK_SET) = 0
read(12, "\n\0\0\0\20\1 \0\1 \1N\1|\1\252\1\330\2\6\0024\2b\2\220\2\276\2\354\3\32"..., 1024) = 1024

_llseek(12, 100352, [100352], SEEK_SET) = 0
read(12, "\n\0\0\0\24\0i\0\0i\0\227\0\305\0\363\1!\1O\1}\1\253\1\331\2\7\0025\2c"..., 1024) = 1024
_llseek(12, 52224, [52224], SEEK_SET)   = 0
read(12, "\n\0\0\0\24\0k\0\0\231\0\307\0\365\1#\1Q\1\177\1\255\1\333\2\t\0027\2d\2\222"..., 1024) = 1024

fcntl64(12, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=1073741824, len=1}, 0xbf8e15e8) = 0
fcntl64(12, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=1073741826, len=510}, 0xbf8e15e8) = -1 EACCES (Permission denied)

Don't mount a subversion repository via a network share, it just won't work reliably. 不要通过网络共享来安装Subversion存储库,否则它将无法可靠地运行。

file:// access is intended for local, single-user access only, particularly testing and debugging. file://访问仅适用于本地单用户访问,尤其是测试和调试。 When you want to share the repository you really need to set up a proper server, and it is not nearly as difficult as you might think. 当您要共享存储库时,您确实需要设置适当的服务器,并且这并不像您想的那样困难。 Read the section called “Accessing the Repository” for guidelines on choosing and setting up a server. 阅读“访问存储库”一节,以获取有关选择和设置服务器的指南。 [link] [链接]

You need to run an SVN server, as David W notes. 如David W所述,您需要运行SVN服务器。

Do you have control over the Windows machine? 您可以控制Windows机器吗? Is port 3690 unblocked? 端口3690是否畅通? Why not use svnserve server on the Windows machine. 为什么不在Windows计算机上使用svnserve服务器。 Then, you don't have to mount file systems. 然后,您不必挂载文件系统。

On your Windows Machine: 在Windows计算机上:

 c:\> svnserve -r C:\path\to\your\repository -d

On your Linux Box 在您的Linux机器上

$ svn co svn://sbs2008/trunk

Another possibility is using VisualSVN Server on your Windows box. 另一种可能性是在Windows 机器上使用VisualSVN Server Then, you could use Apache's httpd to access your repository: 然后,您可以使用Apache的httpd访问您的存储库:

$ svn co http://sbs2008/svn/trunk

VisualSVN Server isn't open source, but it's free as long as you don't need advanced stuff like Windows Active Directory connections. VisualSVN Server不是开源的,但是只要您不需要Windows Active Directory连接之类的高级功能,它都是免费的。

Well. 好。 Let's imagine I dont know and can't understand mount command and parameters. 假设我不知道也无法理解mount命令和参数。

In this case I just ask: 在这种情况下,我只是问:

What exactly you want to do? 您到底想做什么? Work directly with files of repository (not files in repo , but files of )?! 直接使用存储库中的文件(不是repo中的 文件 ,而是的文件 )? For which reasons?! 是出于什么原因?

Subversion have Client-Server architecture , client communicates with server, which hide from client details of handling physical repository backend Subversion具有Client-Server体系结构 ,客户端与服务器进行通信,这从客户端隐藏了处理物理存储库后端的详细信息

Subversion's networking layer is abstracted, meaning that Subversion clients exhibit the same general behaviors no matter what sort of server they are operating against. Subversion的网络层是抽象的,这意味着Subversion客户端无论使用哪种服务器,都表现出相同的常规行为。 Whether speaking the HTTP protocol (http://) with the Apache HTTP Server or speaking the custom Subversion protocol (svn://) with svnserve, the basic network model is the same. 无论是使用Apache HTTP Server说HTTP协议(http://)还是说使用svnserve说自定义Subversion协议(svn://),基本网络模型都是相同的。

You, as client-human, work with physical representation of Repository (state of repo) in Working Copy , logical representation of Repository , provided by a pair of client and server; 您以客户端人员的身份使用由一对客户端和服务器提供的工作副本中的存储库的物理表示形式 (存储库状态), 存储库的 逻辑表示形式 svn-client as client-program communicates with repository server, handling repository, using any of exposed by server access-protocols and server later work with repository at the lowest possible layer (read-write files) svn-client作为客户端程序与 存储库 服务器通信,使用服务器访问协议公开的任何内容来处理存储库,并且服务器稍后在最低可能的层上使用存储库(可读写文件)

This is not so much an answer as a few questions for you to mull over. 这不是一个答案,而是几个问题供您仔细考虑。

Why do you assume that this will work? 您为什么认为这行得通? The cifs file system driver exposes the NTFS file system in such a way that you, in the worst case, can only read files. cifs文件系统驱动程序以一种在最坏的情况下只能读取文件的方式公开NTFS文件系统。 The functionality exposed by the cifs driver has to have a matching functionality in the NTFS end of things. cifs驱动程序公开的功能必须在NTFS末尾具有匹配的功能。

So, if the, by SVN, needed functionality is either unimplemented or unsupported you might very well end up with a problem like this. 因此,如果SVN无法实现或不支持所需的功能,那么您很可能会遇到类似这样的问题。

I'd suggest looking at the cifs documentation and check for known limitations or ways to tweak the driver to, perhaps, offer more functionality. 我建议查看cifs文档,并检查已知的限制或方法来调整驱动程序以提供更多功能。

And, of course, you need to check the ACLs of the exported NTFS file system. 并且,当然,您需要检查导出的NTFS文件系统的ACL。 If this operation is supported by the cifs driver and should work, it will still fail if the NTFS file system has the wrong owner or a read only bit set. 如果cifs驱动程序支持此操作,并且该操作应该起作用,但如果NTFS文件系统的所有者错误或设置了只读位,它仍将失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM