Skip to contentSkip to conversation

Challenge of setting up git server (repository). Please help!

DISCUSSION Gary Yang 4 participants 9 messages Jun 15, 2016

lore
Share & tools
lore

Gary Yang

author
#0 lore raw

I am working on setting up a git server so that people can clone, pull and push their code at git.mycompany.com/pub/git+project path. However, I am having challenges. For people who setup their git servers, please share your experneces with me and tell me what I did wrong. I greatly appreciate it.

After I made configurations, I ran the command, git update-server-info at the public repository machine. But, I got the error.

git pull http://git.mycompany.com/pub/git/u-boot.git HEAD
fatal: http://git.mycompany.com/pub/git/u-boot.git/info/refs not found: did you run git update-server-info on the server?

The file /pub/git/u-boot.git/info/refs dose exist.

cat /pub/git/u-boot.git/info/refs
87ee4576c4c31b7046fe2bbbdf309eaba5c3f346 refs/heads/master

My question:

Is the contet of /pub/git/u-boot.git/hooks/post-update correct? Should I change "exec git-update-server-info" to "exec git update-server-info"?

cat /pub/git/u-boot.git/hooks/post-update
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over

# dumb transports.
#
# To enable this hook, rename this file to "post-update".
exec git-update-server-info

I tried and changed "exec git-update-server-info" to "exec git update-server-info" in /pub/git/u-boot.git/hooks/post-update. But, I still got same error. git pull http://git.mycompany.com/pub/git/u-boot.git HEAD
fatal: http://git.mycompany.com/pub/git/u-boot.git/info/refs not found: did you run git update-server-info on the server?

Which one is correct? "exec git-update-server-info" or "exec git update-server-info"? Eventhogh none of them working.

Below are my settings:

grep 9418 /etc/services
git 9418/tcp # Git Version Control System

grep git /etc/inetd.conf
git stream tcp nowait nobody /usr/local/libexec/git-core/git-daemon git-daemon --inetd --export-all /pub/git

cat /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/local/libexec/git-core/git-daemon
server_args = --inetd --export-all --base-path=/pub/git
log_on_failure += USERID
}

I am running git at Linux box:
uname -a
Linux svdclw004 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:56:44 EST 2007 x86_64 GNU/Linux

Are there anything wrong? Please let me know.

#1 lore raw
Quoted 61 lines · Gary Yang

I am working on setting up a git server so that people can clone, pull and push their code at git.mycompany.com/pub/git+project path. However, I am having challenges. For people who setup their git servers, please share your experneces with me and tell me what I did wrong. I greatly appreciate it.

After I made configurations, I ran the command, git update-server-info at the public repository machine. But, I got the error.

git pull http://git.mycompany.com/pub/git/u-boot.git HEAD
fatal: http://git.mycompany.com/pub/git/u-boot.git/info/refs not found: did you run git update-server-info on the server?

The file /pub/git/u-boot.git/info/refs dose exist.

cat /pub/git/u-boot.git/info/refs
87ee4576c4c31b7046fe2bbbdf309eaba5c3f346 refs/heads/master

My question:

Is the contet of /pub/git/u-boot.git/hooks/post-update correct? Should I change "exec git-update-server-info" to "exec git update-server-info"?

cat /pub/git/u-boot.git/hooks/post-update
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over

# dumb transports.
#
# To enable this hook, rename this file to "post-update".
exec git-update-server-info

I tried and changed "exec git-update-server-info" to "exec git update-server-info" in /pub/git/u-boot.git/hooks/post-update. But, I still got same error. git pull http://git.mycompany.com/pub/git/u-boot.git HEAD
fatal: http://git.mycompany.com/pub/git/u-boot.git/info/refs not found: did you run git update-server-info on the server?

Which one is correct? "exec git-update-server-info" or "exec git update-server-info"? Eventhogh none of them working.

Below are my settings:

grep 9418 /etc/services
git 9418/tcp # Git Version Control System

grep git /etc/inetd.conf
git stream tcp nowait nobody /usr/local/libexec/git-core/git-daemon git-daemon --inetd --export-all /pub/git

cat /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/local/libexec/git-core/git-daemon
server_args = --inetd --export-all --base-path=/pub/git
log_on_failure += USERID
}

Quoted 5 lines

I am running git at Linux box:
uname -a
Linux svdclw004 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:56:44 EST 2007 x86_64 GNU/Linux

Are there anything wrong? Please let me know.

You tried to fetch from a http url, but your settings make no mention of running a web server. git-update-server-info is only relevant in the context of using a web server to serve git repositories via the same http protocol as is used by web servers everywhere. git-daemon, on the other hand, which is what you show configured here, is used to serve git repositories via a git://
url. Its configuration has no effect on whether using http to fetch a git repository will work or not.

Either use a git:// url to fetch the project, or set up a web server which serves stuff under /pub/git.

I'll also mention that you appear to have configuration for both inetd and xinetd, which are two generally mutually-exclusive 'super-servers'; and furthermore, your configurations are inconsistent in the arguments they pass to
git-daemon: it looks like, were you to replace http:// with git://, the inetd config would work as listed, while xinetd would not.

Hope that helps,
Deskin Miller

author
#2 lore raw

Deskin,

Many thanks for your explanation. I hope I understand what you said. I deleted /etc/xinetd.d/git-daemon. Then, I tried to git pull. But, I got connection refused. git uses port 9418. Should I request IT Admin to open the port 9418 for me?

git pull git://git.mycompany.com/pub/git/u-boot.git HEAD git.mycompany.com[0: 10.66.4.168]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)

Another question, I got no output of "netstat | grep 9418". It means no program runs at port 9418 at the public repository machine. Is it correct?

netstat | grep 9418

Quoted 141 lines · Deskin Miller

From: Deskin Miller <[email protected]>
Subject: Re: Challenge of setting up git server (repository). Please help!
To: "Gary Yang" <[email protected]>
Cc: [email protected]
Date: Thursday, November 20, 2008, 2:13 PM

Quoted 2 lines · Gary Yang

I am working on setting up a git server so that people

can clone, pull and push their code at
git.mycompany.com/pub/git+project path.

Quoted 1 line

However, I am having challenges. For people who setup

their git servers, please share your experneces with me and tell me what I did wrong.

Quoted 3 lines

I greatly appreciate it.

After I made configurations, I ran the command, git

update-server-info at the public repository machine. But, I got the error.

Quoted 2 lines

git pull http://git.mycompany.com/pub/git/u-boot.git

HEAD

Quoted 1 line

fatal:

http://git.mycompany.com/pub/git/u-boot.git/info/refs not
found: did you run git update-server-info on the server?

Quoted 5 lines

The file /pub/git/u-boot.git/info/refs dose exist.

cat /pub/git/u-boot.git/info/refs
87ee4576c4c31b7046fe2bbbdf309eaba5c3f346

refs/heads/master

Quoted 4 lines

My question:

Is the contet of /pub/git/u-boot.git/hooks/post-update

correct? Should I change "exec
git-update-server-info" to "exec git
update-server-info"?

Quoted 5 lines

cat /pub/git/u-boot.git/hooks/post-update
#!/bin/sh
#
# An example hook script to prepare a packed

repository for use over

Quoted 3 lines
# dumb transports.
#
# To enable this hook, rename this file to

"post-update".

Quoted 3 lines

exec git-update-server-info

I tried and changed "exec

git-update-server-info" to "exec git update-server-info" in /pub/git/u-boot.git/hooks/post-update. But, I still got same error.

Quoted 1 line

git pull http://git.mycompany.com/pub/git/u-boot.git

HEAD

Quoted 1 line

fatal:

http://git.mycompany.com/pub/git/u-boot.git/info/refs not
found: did you run git update-server-info on the server?

Quoted 2 lines

Which one is correct? "exec

git-update-server-info" or "exec git update-server-info"? Eventhogh none of them working.

Quoted 5 lines

Below are my settings:

grep 9418 /etc/services
git 9418/tcp # Git

Version Control System

Quoted 4 lines

grep git /etc/inetd.conf
git stream tcp nowait nobody

/usr/local/libexec/git-core/git-daemon git-daemon --inetd --export-all /pub/git

Quoted 5 lines

cat /etc/xinetd.d/git-daemon
# default: off
# description: The git server offers access to git

repositories

Quoted 9 lines

service git
{
disable = no
type = UNLISTED
port = 9418
socket_type = stream
wait = no
user = nobody
server =

/usr/local/libexec/git-core/git-daemon

Quoted 1 line
        server_args     = --inetd --export-all

--base-path=/pub/git

Quoted 7 lines
        log_on_failure  += USERID
}

I am running git at Linux box:
uname -a
Linux svdclw004 2.6.9-67.ELsmp #1 SMP Wed Nov 7

13:56:44 EST 2007 x86_64 GNU/Linux

Quoted 2 lines

Are there anything wrong? Please let me know.

You tried to fetch from a http url, but your settings make no mention of
running a web server. git-update-server-info is only relevant in the context
of using a web server to serve git repositories via the same http protocol as
is used by web servers everywhere. git-daemon, on the other hand, which is
what you show configured here, is used to serve git repositories via a git://
url. Its configuration has no effect on whether using http to fetch a git
repository will work or not.

Either use a git:// url to fetch the project, or set up a web server which
serves stuff under /pub/git.

I'll also mention that you appear to have configuration for both inetd and
xinetd, which are two generally mutually-exclusive 'super-servers'; and
furthermore, your configurations are inconsistent in the arguments they pass to
git-daemon: it looks like, were you to replace http:// with
git://, the inetd
config would work as listed, while xinetd would not.

Hope that helps,
Deskin Miller

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 1 line · Gary Yang

Many thanks for your explanation. I hope I understand what you said. I deleted /etc/xinetd.d/git-daemon. Then, I tried to git pull. But, I got connection refused. git uses port 9418. Should I request IT Admin to open the port 9418 for me?

You'll need port 9418 open, yes; but since it's an unprivileged port (1024 or
higher), you can use it as a regular user and don't need IT intervention unless you have some firewall set up which they need to override for you.

Quoted 3 lines

git pull git://git.mycompany.com/pub/git/u-boot.git HEAD git.mycompany.com[0: 10.66.4.168]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)

It's possible, and likely simpler, to use git-daemon directly, instead of having it be managed by inetd; especially for initial debugging, I'd recommend getting that working before trying to determine if you're having issues with inetd configuration: to do so, just run git-daemon with all the same arguments except for --inetd.

You said you deleted the xinetd config, but that's only relevant if your machine actually uses inetd as its super-server. You should do 'ps -A | grep inetd' (which will match either inetd or xinetd), and see which one is running. If it's inetd, you should be all set, and the issue doesn't look like inetd (assuming you sent it a signal to reload its config file). If on the other hand xinetd is running, you need to use the xinetd config file, and fix the server_args to look like the arguments which exist in the inetd file. Again, you need to signal xinetd at this point to reload its configuration.

Based on the linux kernel version you're reporting, I'm guessing you have some sort of Red Hat based system, which uses xinetd to the best of my knowledge.

Quoted 3 lines

Another question, I got no output of "netstat | grep 9418". It means no program runs at port 9418 at the public repository machine. Is it correct?

netstat | grep 9418

netstat translates IP addresses to dns names, and ports to service names by default; so, given the line listed in /etc/services, this will show '0.0.0.0:git' or something. Also, it lists established connections, not listening sockets, by default. I'd recommend spending some time with the man page if you're going to use it to debug your setup.

Deskin Miller

author
#4 lore raw

I ran the command,"sudo /usr/local/libexec/git-core/git-daemon git-daemon --export-all /pub/git &" at public repository machine.

At my private machine, I ran, git pull git://svdcgit01.amcc.com/pub/git/u-boot.git HEAD"

I got: "fatal: The remote end hung up unexpectedly"

At the public repository server, I got "'/pub/git/u-boot.git': repository not exported." Any idea of this error?

ps -A | grep inetd
8874 ? 00:00:00 xinetd

It means it uses xinetd.

I copied git-daemon back to /etc/xinetd.d and added git-daemon to the server_args. See below:

cat /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/local/libexec/git-core/git-daemon
server_args = git-daemon --inetd --export-all --base-path=/pub/git
log_on_failure += USERID
}

I kill the daemon "/usr/local/libexec/git-core/git-daemon git-daemon --export-all /pub/git &".

Back to my private box, and did git pull. I got Connection refused again. what I did wrong?

git pull git://svdcgit01.amcc.com/pub/git/u-boot.git HEAD svdcgit01.amcc.com[0: 10.66.4.168]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)

Quoted 73 lines · Deskin Miller

From: Deskin Miller <[email protected]>
Subject: Re: Challenge of setting up git server (repository). Please help!
To: "Gary Yang" <[email protected]>
Cc: [email protected]
Date: Thursday, November 20, 2008, 3:08 PM

Quoted 1 line · Gary Yang

Many thanks for your explanation. I hope I understand

what you said. I deleted /etc/xinetd.d/git-daemon. Then, I tried to git pull. But, I got connection refused. git uses port 9418. Should I request IT Admin to open the port 9418 for me?

You'll need port 9418 open, yes; but since it's an unprivileged port (1024 or
higher), you can use it as a regular user and don't need IT intervention unless you have some firewall set up which they need to override for you.

Quoted 1 line

git pull git://git.mycompany.com/pub/git/u-boot.git

HEAD

Quoted 1 line

git.mycompany.com[0: 10.66.4.168]: errno=Connection

refused

Quoted 1 line

fatal: unable to connect a socket (Connection refused)

It's possible, and likely simpler, to use git-daemon directly, instead of
having it be managed by inetd; especially for initial debugging, I'd recommend
getting that working before trying to determine if you're having issues with
inetd configuration: to do so, just run git-daemon with all the same arguments
except for --inetd.

You said you deleted the xinetd config, but that's only relevant if your
machine actually uses inetd as its super-server. You should do 'ps -A | grep
inetd' (which will match either inetd or xinetd), and see which one is running.
If it's inetd, you should be all set, and the issue doesn't look like inetd
(assuming you sent it a signal to reload its config file). If on the other
hand xinetd is running, you need to use the xinetd config file, and fix the
server_args to look like the arguments which exist in the inetd file. Again,
you need to signal xinetd at this point to reload its configuration.

Based on the linux kernel version you're reporting, I'm guessing you have some
sort of Red Hat based system, which uses xinetd to the best of my knowledge.

Quoted 1 line

Another question, I got no output of "netstat |

grep 9418". It means no program runs at port 9418 at the public repository machine. Is it correct?

Quoted 2 lines

netstat | grep 9418

netstat translates IP addresses to dns names, and ports to service names by
default; so, given the line listed in /etc/services, this will show
'0.0.0.0:git' or something. Also, it lists established connections, not
listening sockets, by default. I'd recommend spending some time with the man
page if you're going to use it to debug your setup.

Deskin Miller

author
#5 lore raw

Do I need to restart xinetd after I made changes in /etc/xinetd.d/git-daemon?

Quoted 177 lines · Gary Yang

From: Gary Yang <[email protected]>
Subject: Re: Challenge of setting up git server (repository). Please help!
To: "Deskin Miller" <[email protected]>
Cc: [email protected]
Date: Thursday, November 20, 2008, 3:48 PM
I ran the command,"sudo
/usr/local/libexec/git-core/git-daemon git-daemon
--export-all /pub/git &" at public repository
machine.

At my private machine, I ran, git pull
git://svdcgit01.amcc.com/pub/git/u-boot.git HEAD"

I got: "fatal: The remote end hung up
unexpectedly"

At the public repository server, I got
"'/pub/git/u-boot.git': repository not
exported." Any idea of this error?

ps -A | grep inetd
8874 ? 00:00:00 xinetd

It means it uses xinetd.

I copied git-daemon back to /etc/xinetd.d and added git-daemon to the server_args. See below:

cat /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/local/libexec/git-core/git-daemon

        server_args     = git-daemon --inetd --export-all
--base-path=/pub/git
        log_on_failure  += USERID
}

I kill the daemon "/usr/local/libexec/git-core/git-daemon git-daemon --export-all /pub/git &".

Back to my private box, and did git pull. I got Connection refused again. what I did wrong?

git pull git://svdcgit01.amcc.com/pub/git/u-boot.git HEAD svdcgit01.amcc.com[0: 10.66.4.168]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)

--- On Thu, 11/20/08, Deskin Miller

Quoted 2 lines · <[email protected]> wrote:

From: Deskin Miller <[email protected]>
Subject: Re: Challenge of setting up git server

(repository). Please help!

Quoted 4 lines

To: "Gary Yang" <[email protected]>
Cc: [email protected]
Date: Thursday, November 20, 2008, 3:08 PM On Thu, Nov 20, 2008 at 02:43:30PM -0800, Gary Yang

Quoted 1 line · wrote:
Quoted 1 line

Many thanks for your explanation. I hope I

understand

Quoted 1 line

what you said. I deleted /etc/xinetd.d/git-daemon.

Then, I

Quoted 1 line

tried to git pull. But, I got connection refused. git

uses

Quoted 1 line

port 9418. Should I request IT Admin to open the port

9418

Quoted 3 lines

for me?

You'll need port 9418 open, yes; but since

it's an

Quoted 2 lines

unprivileged port (1024 or
higher), you can use it as a regular user and

don't

Quoted 1 line

need IT intervention unless you have some firewall set

up

Quoted 3 lines

which they need to override for you.

Quoted 1 line

git pull

git://git.mycompany.com/pub/git/u-boot.git

Quoted 2 lines

HEAD

Quoted 1 line

git.mycompany.com[0: 10.66.4.168]:

errno=Connection

Quoted 2 lines

refused

Quoted 1 line

fatal: unable to connect a socket (Connection

refused)

Quoted 2 lines

It's possible, and likely simpler, to use

git-daemon

Quoted 6 lines

directly, instead of
having it be managed by inetd; especially for initial debugging, I'd recommend
getting that working before trying to determine if you're having issues with
inetd configuration: to do so, just run git-daemon

with all

Quoted 4 lines

the same arguments
except for --inetd.

You said you deleted the xinetd config, but that's

only

Quoted 4 lines

relevant if your
machine actually uses inetd as its super-server. You should do 'ps -A | grep
inetd' (which will match either inetd or xinetd),

and

Quoted 2 lines

see which one is running.
If it's inetd, you should be all set, and the

issue

Quoted 2 lines

doesn't look like inetd
(assuming you sent it a signal to reload its config

file).

Quoted 2 lines

If on the other
hand xinetd is running, you need to use the xinetd

config

Quoted 2 lines

file, and fix the
server_args to look like the arguments which exist in

the

Quoted 5 lines

inetd file. Again,
you need to signal xinetd at this point to reload its configuration.

Based on the linux kernel version you're

reporting,

Quoted 2 lines

I'm guessing you have some
sort of Red Hat based system, which uses xinetd to the

best

Quoted 3 lines

of my knowledge.

Quoted 1 line

Another question, I got no output of

"netstat |

Quoted 1 line

grep 9418". It means no program runs at port 9418

at

Quoted 5 lines

the public repository machine. Is it correct?

Quoted 2 lines

netstat | grep 9418

netstat translates IP addresses to dns names, and

ports to

Quoted 2 lines

service names by
default; so, given the line listed in /etc/services,

this

Quoted 4 lines

will show
'0.0.0.0:git' or something. Also, it lists
established connections, not
listening sockets, by default. I'd recommend

spending

Quoted 2 lines

some time with the man
page if you're going to use it to debug your

setup.

Quoted 2 lines

Deskin Miller

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html

#6 lore raw

Yes.

- John 'Warthog9' Hawley
Chief Kernel.org Administrator

Quoted 189 lines · Gary Yang

Do I need to restart xinetd after I made changes in /etc/xinetd.d/git-daemon?

Quoted 171 lines · Gary Yang

From: Gary Yang <[email protected]>
Subject: Re: Challenge of setting up git server (repository). Please help!
To: "Deskin Miller" <[email protected]>
Cc: [email protected]
Date: Thursday, November 20, 2008, 3:48 PM
I ran the command,"sudo
/usr/local/libexec/git-core/git-daemon git-daemon
--export-all /pub/git &" at public repository
machine.

At my private machine, I ran, git pull
git://svdcgit01.amcc.com/pub/git/u-boot.git HEAD"

I got: "fatal: The remote end hung up
unexpectedly"

At the public repository server, I got
"'/pub/git/u-boot.git': repository not
exported." Any idea of this error?

ps -A | grep inetd
8874 ? 00:00:00 xinetd

It means it uses xinetd.

I copied git-daemon back to /etc/xinetd.d and added git-daemon to the server_args. See below:

cat /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/local/libexec/git-core/git-daemon

        server_args     = git-daemon --inetd --export-all
--base-path=/pub/git
        log_on_failure  += USERID
}

I kill the daemon "/usr/local/libexec/git-core/git-daemon git-daemon --export-all /pub/git &".

Back to my private box, and did git pull. I got Connection refused again. what I did wrong?

git pull git://svdcgit01.amcc.com/pub/git/u-boot.git HEAD svdcgit01.amcc.com[0: 10.66.4.168]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)

--- On Thu, 11/20/08, Deskin Miller

Quoted 2 lines · <[email protected]> wrote:

From: Deskin Miller <[email protected]>
Subject: Re: Challenge of setting up git server

(repository). Please help!

Quoted 4 lines

To: "Gary Yang" <[email protected]>
Cc: [email protected]
Date: Thursday, November 20, 2008, 3:08 PM On Thu, Nov 20, 2008 at 02:43:30PM -0800, Gary Yang

Quoted 1 line · wrote:
Quoted 1 line

Many thanks for your explanation. I hope I

understand

Quoted 1 line

what you said. I deleted /etc/xinetd.d/git-daemon.

Then, I

Quoted 1 line

tried to git pull. But, I got connection refused. git

uses

Quoted 1 line

port 9418. Should I request IT Admin to open the port

9418

Quoted 3 lines

for me?

You'll need port 9418 open, yes; but since

it's an

Quoted 2 lines

unprivileged port (1024 or
higher), you can use it as a regular user and

don't

Quoted 1 line

need IT intervention unless you have some firewall set

up

Quoted 3 lines

which they need to override for you.

Quoted 1 line

git pull

git://git.mycompany.com/pub/git/u-boot.git

Quoted 2 lines

HEAD

Quoted 1 line

git.mycompany.com[0: 10.66.4.168]:

errno=Connection

Quoted 2 lines

refused

Quoted 1 line

fatal: unable to connect a socket (Connection

refused)

Quoted 2 lines

It's possible, and likely simpler, to use

git-daemon

Quoted 6 lines

directly, instead of
having it be managed by inetd; especially for initial debugging, I'd recommend
getting that working before trying to determine if you're having issues with
inetd configuration: to do so, just run git-daemon

with all

Quoted 4 lines

the same arguments
except for --inetd.

You said you deleted the xinetd config, but that's

only

Quoted 4 lines

relevant if your
machine actually uses inetd as its super-server. You should do 'ps -A | grep
inetd' (which will match either inetd or xinetd),

and

Quoted 2 lines

see which one is running.
If it's inetd, you should be all set, and the

issue

Quoted 2 lines

doesn't look like inetd
(assuming you sent it a signal to reload its config

file).

Quoted 2 lines

If on the other
hand xinetd is running, you need to use the xinetd

config

Quoted 2 lines

file, and fix the
server_args to look like the arguments which exist in

the

Quoted 5 lines

inetd file. Again,
you need to signal xinetd at this point to reload its configuration.

Based on the linux kernel version you're

reporting,

Quoted 2 lines

I'm guessing you have some
sort of Red Hat based system, which uses xinetd to the

best

Quoted 3 lines

of my knowledge.

Quoted 1 line

Another question, I got no output of

"netstat |

Quoted 1 line

grep 9418". It means no program runs at port 9418

at

Quoted 5 lines

the public repository machine. Is it correct?

Quoted 2 lines

netstat | grep 9418

netstat translates IP addresses to dns names, and

ports to

Quoted 2 lines

service names by
default; so, given the line listed in /etc/services,

this

Quoted 4 lines

will show
'0.0.0.0:git' or something. Also, it lists
established connections, not
listening sockets, by default. I'd recommend

spending

Quoted 2 lines

some time with the man
page if you're going to use it to debug your

setup.

Quoted 2 lines

Deskin Miller

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#7 lore raw

I am not system admin. How to restart it? Can I do this?

sudo xinetd -stayalive -pidfile /var/run/xinetd.pid

Below is the output of current running xinetd

ps -efww | grep xinetd
root 8874 1 0 Sep24 ? 00:00:00 xinetd -stayalive -pidfile /var/run/xinetd.pid

Thanks.

Quoted 258 lines · J.H.

From: J.H. <[email protected]>
Subject: Re: Challenge of setting up git server (repository). Please help!
To: [email protected]
Cc: "Deskin Miller" <[email protected]>, [email protected]
Date: Thursday, November 20, 2008, 3:59 PM
Yes.

- John 'Warthog9' Hawley
Chief Kernel.org Administrator

Quoted 1 line · Gary Yang

Do I need to restart xinetd after I made changes in

/etc/xinetd.d/git-daemon?

Quoted 3 lines

--- On Thu, 11/20/08, Gary Yang

Quoted 3 lines · <[email protected]> wrote:
Quoted 3 lines

From: Gary Yang <[email protected]>
Subject: Re: Challenge of setting up git server

(repository). Please help!

Quoted 1 line
Quoted 1 line

To: "Deskin Miller"

<[email protected]>

Quoted 5 lines
Quoted 5 lines

Cc: [email protected]
Date: Thursday, November 20, 2008, 3:48 PM
I ran the command,"sudo
/usr/local/libexec/git-core/git-daemon git-daemon
--export-all /pub/git &" at public

repository

Quoted 4 lines
Quoted 4 lines

machine.

At my private machine, I ran, git pull
git://svdcgit01.amcc.com/pub/git/u-boot.git

HEAD"

Quoted 6 lines
Quoted 6 lines

I got: "fatal: The remote end hung up
unexpectedly"

At the public repository server, I got
"'/pub/git/u-boot.git': repository

not

Quoted 9 lines
Quoted 9 lines

exported." Any idea of this error?

ps -A | grep inetd
8874 ? 00:00:00 xinetd

It means it uses xinetd.

I copied git-daemon back to /etc/xinetd.d and

added

Quoted 5 lines
Quoted 5 lines

git-daemon to the server_args. See below:

cat /etc/xinetd.d/git-daemon
# default: off
# description: The git server offers access to

git

Quoted 4 lines
Quoted 4 lines

repositories
service git
{
disable = no

Quoted 8 lines
Quoted 8 lines
        type            = UNLISTED
        port            = 9418
        socket_type     = stream
        wait            = no
        user            = nobody
        server          =
/usr/local/libexec/git-core/git-daemon
        server_args     = git-daemon --inetd

--export-all

Quoted 7 lines
Quoted 7 lines

--base-path=/pub/git

        log_on_failure  += USERID
}

I kill the daemon
"/usr/local/libexec/git-core/git-daemon

git-daemon

Quoted 3 lines
Quoted 3 lines

--export-all /pub/git &".

Back to my private box, and did git pull. I got

Connection

Quoted 3 lines
Quoted 3 lines

refused again. what I did wrong?

git pull

git://svdcgit01.amcc.com/pub/git/u-boot.git HEAD

Quoted 1 line
Quoted 1 line

svdcgit01.amcc.com[0: 10.66.4.168]:

errno=Connection

Quoted 2 lines
Quoted 2 lines

refused
fatal: unable to connect a socket (Connection

refused)

Quoted 8 lines
Quoted 8 lines

--- On Thu, 11/20/08, Deskin Miller

Quoted 1 line · <[email protected]> wrote:

From: Deskin Miller

<[email protected]>

Quoted 1 line
Quoted 1 line
Quoted 1 line

Subject: Re: Challenge of setting up git

server

Quoted 2 lines
Quoted 2 lines

(repository). Please help!

Quoted 1 line

To: "Gary Yang"

<[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Cc: [email protected]
Date: Thursday, November 20, 2008, 3:08 PM
On Thu, Nov 20, 2008 at 02:43:30PM -0800,

Gary Yang

Quoted 2 lines
Quoted 2 lines
Quoted 1 line · wrote:
Quoted 1 line

Many thanks for your explanation. I

hope I

Quoted 2 lines
Quoted 2 lines

understand

Quoted 1 line

what you said. I deleted

/etc/xinetd.d/git-daemon.

Quoted 2 lines
Quoted 2 lines

Then, I

Quoted 1 line

tried to git pull. But, I got connection

refused. git

Quoted 2 lines
Quoted 2 lines

uses

Quoted 1 line

port 9418. Should I request IT Admin to open

the port

Quoted 4 lines
Quoted 4 lines

9418

Quoted 3 lines

for me?

You'll need port 9418 open, yes; but

since

Quoted 3 lines
Quoted 3 lines

it's an

Quoted 2 lines

unprivileged port (1024 or
higher), you can use it as a regular user

and

Quoted 2 lines
Quoted 2 lines

don't

Quoted 1 line

need IT intervention unless you have some

firewall set

Quoted 10 lines
Quoted 10 lines

up

Quoted 3 lines

which they need to override for you.

Quoted 1 line

git pull

git://git.mycompany.com/pub/git/u-boot.git

Quoted 2 lines

HEAD

Quoted 1 line

git.mycompany.com[0: 10.66.4.168]:

errno=Connection

Quoted 2 lines

refused

Quoted 1 line

fatal: unable to connect a socket

(Connection

Quoted 3 lines
Quoted 3 lines

refused)

Quoted 2 lines

It's possible, and likely simpler, to

use

Quoted 3 lines
Quoted 3 lines

git-daemon

Quoted 2 lines

directly, instead of
having it be managed by inetd; especially

for initial

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

debugging, I'd recommend
getting that working before trying to

determine if

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

you're having issues with
inetd configuration: to do so, just run

git-daemon

Quoted 5 lines
Quoted 5 lines

with all

Quoted 4 lines

the same arguments
except for --inetd.

You said you deleted the xinetd config, but

that's

Quoted 3 lines
Quoted 3 lines

only

Quoted 2 lines

relevant if your
machine actually uses inetd as its

super-server. You

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

should do 'ps -A | grep
inetd' (which will match either inetd or

xinetd),

Quoted 3 lines
Quoted 3 lines

and

Quoted 2 lines

see which one is running.
If it's inetd, you should be all set,

and the

Quoted 3 lines
Quoted 3 lines

issue

Quoted 2 lines

doesn't look like inetd
(assuming you sent it a signal to reload its

config

Quoted 3 lines
Quoted 3 lines

file).

Quoted 2 lines

If on the other
hand xinetd is running, you need to use the

xinetd

Quoted 3 lines
Quoted 3 lines

config

Quoted 2 lines

file, and fix the
server_args to look like the arguments which

exist in

Quoted 3 lines
Quoted 3 lines

the

Quoted 2 lines

inetd file. Again,
you need to signal xinetd at this point to

reload its

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

configuration.

Based on the linux kernel version you're

reporting,

Quoted 2 lines

I'm guessing you have some
sort of Red Hat based system, which uses

xinetd to the

Quoted 6 lines
Quoted 6 lines

best

Quoted 3 lines

of my knowledge.

Quoted 1 line

Another question, I got no output of

"netstat |

Quoted 1 line

grep 9418". It means no program runs at

port 9418

Quoted 2 lines
Quoted 2 lines

at

Quoted 1 line

the public repository machine. Is it

correct?

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

netstat | grep 9418

netstat translates IP addresses to dns

names, and

Quoted 3 lines
Quoted 3 lines

ports to

Quoted 2 lines

service names by
default; so, given the line listed in

/etc/services,

Quoted 3 lines
Quoted 3 lines

this

Quoted 2 lines

will show
'0.0.0.0:git' or something. Also,

it lists

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

established connections, not
listening sockets, by default. I'd

recommend

Quoted 3 lines
Quoted 3 lines

spending

Quoted 2 lines

some time with the man
page if you're going to use it to debug

your

Quoted 10 lines
Quoted 10 lines

setup.

Quoted 2 lines

Deskin Miller

--
To unsubscribe from this list: send the line
"unsubscribe git" in
the body of a message to

[email protected]

Quoted 7 lines
Quoted 2 lines

More majordomo info at
http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line

"unsubscribe git" in

Quoted 2 lines

the body of a message to [email protected] More majordomo info at

http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html

#8 lore raw
In reply to Gary Yang
Quoted 1 line · Gary Yang

I am working on setting up a git server so that people can clone, pull and push their code at git.mycompany.com/pub/git+project path. However, I am having challenges. For people who setup their git servers, please share your experneces with me and tell me what I did wrong. I greatly appreciate it.

Have you tried just using gitosis? It's very nice.

http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way is what I read to get started.

Keep in mind you can't clone a git repository with no commits.

-- Asheesh.

Signature · 1 line
You look tired.