I'm trying to set up a git public repository for my team.

I have installed Git on a linux box (RedHat 5.6).

As a first step, i'm trying to configure Git to use the git protocol, by setting it up to run through xinetd.

Here's the contents of /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
}

According to /var/log/messages the service is started correctly.

When trying to clone a test (bare) repository, i am getting a failure:

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

Running the same command that is configured for xinetd from the shell seems to work fine:

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

Now cloning works.

What am i doing wrong here? Can't seem to find a solution.

link|improve this question
Thanks, but this didn't contain anything useful for my case... – liortal Aug 17 '11 at 8:49
I see that my windows machine has Git 1.7.3 while the server has 1.7.6. Trying to upgrade to match versions and see if that will solve the problem. – liortal Aug 17 '11 at 9:06
Both at version 1.7.6, still getting the same output. – liortal Aug 17 '11 at 9:14
feedback

2 Answers

Maybe /usr/bin/git is not in the PATH.

Add env += GIT_TRACE=/tmp/git-xinetd.log into the /etc/xinetd.d/git-daemon and try again to see what does log say?

link|improve this answer
This just gives a trace of the command that runs: trace: exec: 'git-daemon' '--verbose' '--inetd' '--export-all' '--base-path=/tmp' trace: run_command: 'git-daemon' '--verbose' '--inetd' '--export-all' '--base-path=/tmp' – liortal Aug 17 '11 at 10:20
Also, running git from any directory i am in seems to work, so i don't believe this is a PATH issue. – liortal Aug 17 '11 at 10:21
Did you try git clone from client after adding? – quanta Aug 17 '11 at 10:30
What do you mean git clone from the client? The output i pasted here was the one displayed when i try to run git clone from my windows client box. – liortal Aug 17 '11 at 10:38
Your path may not be the same path that xinetd is operating with. That said, it appears that the daemon command is running appropriately. I think you may need to look at a lower level... I'd start confirming each step with external tools -- atop, wireshark, etc. Also, consider the possibility of a version mismatch. – Jeff Ferland Aug 17 '11 at 14:07
show 2 more comments
feedback

The problem was with the user that i've used for setting up xinetd.

I changed this to be root (for now), and i can now happily clone the repository from other clients.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.