0

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.

4
  • git.wiki.kernel.org/index.php/…
    – quanta
    Aug 17, 2011 at 8:38
  • Thanks, but this didn't contain anything useful for my case...
    – liortal
    Aug 17, 2011 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, 2011 at 9:06
  • Both at version 1.7.6, still getting the same output.
    – liortal
    Aug 17, 2011 at 9:14

3 Answers 3

1

"fata" is the beginning of "fatal", git clone truncates it, so you may directly try to use nc 10.161.202.45 9418 to get the full message returned by git daemon, then if this is not enough for you to fix it, you may temporarily replace /usr/bin/git by /usr/bin/strace in the server field of the xinetd config, and prepend -f /usr/bin/git to the server_args field. It's likely a permissions error, maybe you have a /.git/ own by root, and git daemon likely run as less privileged git user, chokes when trying to read /.git/config

0

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?

7
  • 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, 2011 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, 2011 at 10:21
  • Did you try git clone from client after adding?
    – quanta
    Aug 17, 2011 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, 2011 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. Aug 17, 2011 at 14:07
0

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.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .