从xinetd运行时,Git守护进程无法正常工作

我正在尝试为我的团队设置一个git公共存储库。

我已经在一个Linux机器上安装了Git(RedHat 5.6)。

作为第一步,我试图configurationGit使用git协议,通过设置它来运行xinetd。

以下是/etc/xinetd.d/git-daemon的内容:

# default: off # description: The git server offers access to git repositories service git { disable = no type = UNLISTED port = 9418 socket_type = stream wait = no user = nobody server = /usr/bin/git/git log_type = FILE /var/log/git-daemon server_args = daemon --verbose --inetd --export-all --base-path=/tmp log_on_failure += USERID } 

根据/ var / log /消息,服务启动正确。

当试图克隆testing(裸)存储库,我得到一个失败:

 C:\Users\ltal>git clone git://10.161.202.45/lior-test.git c:\liorssf Cloning into c:\liorssf... fatal: protocol error: bad line length character: fata 

运行相同的命令,从shellconfiguration为xinetd似乎正常工作:

 /usr/bin/git/git daemon --verbose --export-all --base-path=/tmp & 

现在克隆工作。

我在这里做错了什么? 似乎无法find解决scheme。

“fata”是“fatal”的开始, git clone截断它,所以你可以直接尝试使用nc 10.161.202.45 9418来获取git守护进程返回的完整信息,如果这不足以解决问题,你可以在xinetd config的服务器字段中用/usr/bin/strace暂时replace/usr/bin/git ,然后在server_args字段中加上-f /usr/bin/git 。 这可能是一个权限错误,也许你有一个/.git/自己的根,和git daemon可能运行作为权限较低的git用户,尝试读取/.git/config时扼stream圈…

也许/usr/bin/git不在PATH中。

env += GIT_TRACE=/tmp/git-xinetd.log/etc/xinetd.d/git-daemon然后再次尝试查看日志说的是什么?

问题出在用于设置xinetd的用户。

我改变这是根(现在),我现在可以快乐地克隆其他客户端的存储库。