threads / discuss / 26182

git-daemon serving repos with repo.git/git-daemon-export-ok

Subject: git-daemon serving repos with repo.git/git-daemon-export-ok

## tl;dr

8 messages between Jan 3, 2011 and Jan 4, 2011.

replies: 7people: 2as markdown or json

John Griessen· Jan 3, 2011, 21:49 UTC · lore

I would like to serving repos with repo.git/git-daemon-export-ok from a debian linux server installation, but I am getting symptoms of clone failing.

john@toolbench:~/EEProjects/test$ git clone git://ecosensory.com/tek_7k_ext.git Cloning into tek_7k_ext... fatal: protocol error: bad line length character: fata

I've read that that is due to the shell at the client end putting out extra characters... but other testers on other machines get it the same way...

Next I tried changing my command that runs git-daemon from

exec 2>&1
echo 'git-daemon starting.'
exec chpst -ugitdaemon \
   "$(git --exec-path)"/git-daemon --verbose --base-path=/var/cache /var/cache/git
to
exec 2>&1
echo 'git-daemon starting.'
exec chpst -ugitdaemon \
   "$(git --exec-path)"/git-daemon --verbose --base-path=/srv/gitosis /srv/gitosis/repositories
and results are:

john@toolbench:~/EEProjects/test$ git clone git://ecosensory.com/tek_7k_ext.git Cloning into tek_7k_ext... fatal: protocol error: bad line length character: fata john@toolbench:~/EEProjects/test$ git clone git://ecosensory.com/repositories/tek_7k_ext.git Cloning into tek_7k_ext... fatal: protocol error: bad line length character: fata

What can I do to simplify this testing and pin point the problem?
Or is gitweb recommended?
thanks,
John Griessen
John Griessen· Jan 3, 2011, 22:47 UTC · re: John Griessen · lore

Re: git-daemon serving repos with repo.git/git-daemon-export-ok

On 01/03/2011 03:49 PM, John Griessen wrote:
> I would like to serve repos with repo.git/git-daemon-export-ok from a debian linux server installation
on a  virtual server (openVZ) --  I've read there is something bad about virtual servers and git-daemon?
John G
Jonathan Nieder· Jan 3, 2011, 23:11 UTC · re: John Griessen · lore

Re: git-daemon serving repos with repo.git/git-daemon-export-ok

Hi John,
John Griessen wrote:
> john@toolbench:~/EEProjects/test$ git clone git://ecosensory.com/tek_7k_ext.git
> Cloning into tek_7k_ext...
> fatal: protocol error: bad line length character: fata
[...]
Show 7 quoted lines
> Next I tried changing my command that runs git-daemon
> from
> 
> exec 2>&1
> echo 'git-daemon starting.'
> exec chpst -ugitdaemon \
>   "$(git --exec-path)"/git-daemon --verbose --base-path=/var/cache /var/cache/git

Worrisome. Based on /usr/share/doc/git-daemon-run/README.Debian, I would be interested in:

	git --version
	dpkg -l git-daemon-run
	sv stat git-daemon
	cat /var/log/git-daemon/current

It looks like the daemon is sending a malformed reply starting with "fatal: ", similar to the bug fixed by v1.7.0.3~7 (daemon: parse_host_and_port SIGSEGV if port is specified, 2010-03-20).

It the error message does not provide any insight, I'd also suggest using strace or ltrace to attach to the running git-daemon process to see what's going on.

Thanks for reporting, Jonathan

John Griessen· Jan 3, 2011, 23:38 UTC · re: Jonathan Nieder · lore

Re: git-daemon serving repos with repo.git/git-daemon-export-ok

On 01/03/2011 05:11 PM, Jonathan Nieder wrote:
> Hi John,
Show 5 quoted lines
>
> Worrisome.  Based on /usr/share/doc/git-daemon-run/README.Debian,
> I would be interested in:
>
> 	git --version

server: vking@mail:/etc/sv$ git --version git version 1.7.2.3

client: john@toolbench:~/EEProjects/tek_7k_ext$ git version 1.7.2.3 git version 1.7.2.3

> 	dpkg -l git-daemon-run
dpkg -l git-daemon-run
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                           Version                        Description
+++-==============================-==============================-============================================================================
pc  git-daemon-run                 1:1.7.2.3-2.2                  fast, scalable, distributed revision contro
> 	sv stat git-daemon

vking@mail:/etc/sv$ sv stat git-daemon fail: git-daemon: unable to change to service directory: file does not exist

I uninstalled it  so I could run a command line like:

sudo /usr/lib/git-core/git-daemon --verbose --strict-paths --user=git --group=gitosis /srv/gitosis/repositories or sudo strace -o strace.out /usr/lib/git-core/git-daemon --verbose --strict-paths --user=git --group=gitosis /srv/gitosis/repositories

I can push to these repos with gitosis, and the permissions are:

vking@mail:/srv/gitosis/repositories$ ll total 16 drwxr-xr-x 7 gitosis gitosis 4096 Dec 30 12:32 extrudator.data.git drwxr-xr-x 7 gitosis gitosis 4096 Nov 7 15:23 extrudator.git drwxr-xr-x 8 gitosis gitosis 4096 Jan 3 14:42 gitosis-admin.git drwxr-xr-x 7 gitosis gitosis 4096 Jan 2 23:46 tek_7k_ext.git

/etc/group on server git:x:111: gitosis:x:115:git

/etc/passwd on server git:x:106:111:git version control,,,:/home/git:/bin/shh gitlog:x:108:65534::/nonexistent:/bin/false gitosis:x:110:115:git repository hosting,,,:/srv/gitosis:/bin/sh

> 	cat /var/log/git-daemon/current

john@toolbench:~/EEProjects/tek_7k_ext$ cat /var/log/git-daemon/current cat: /var/log/git-daemon/current: No such file or directory

Thanks for looking at this.
John Griessen
===================================strace output================
vking@mail:/etc/sv$ cat strace.out
execve("/usr/lib/git-core/git-daemon", ["/usr/lib/git-core/git-daemon", "--verbose", "--strict-paths", "--user=git", 
"--group=gitosis", "/srv/gitosis/repositories"], [/* 10 vars */]) = 0
brk(0)                                  = 0x89c1000
uname({sys="Linux", node="mail.cibolo.us", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f19000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=22893, ...}) = 0
mmap2(NULL, 22893, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f13000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/libz.so.1", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300\30\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=81012, ...}) = 0
mmap2(NULL, 83740, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x62c000
mmap2(0x640000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13) = 0x640000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libpthread.so.0", O_RDONLY)  = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`I\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=117105, ...}) = 0
mmap2(NULL, 98784, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xbbf000
mprotect(0xbd3000, 4096, PROT_NONE)     = 0
mmap2(0xbd4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14) = 0xbd4000
mmap2(0xbd6000, 4576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xbd6000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320m\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1315080, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f12000
mmap2(NULL, 1325384, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x110000
mmap2(0x24e000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13d) = 0x24e000
mmap2(0x251000, 10568, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x251000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f11000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f116c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, 
limit_in_pages:1, seg_not_present:0, useable:1}) = 0
open("/dev/urandom", O_RDONLY)          = 3
read(3, "\367\3Y", 3)                   = 3
close(3)                                = 0
mprotect(0x24e000, 8192, PROT_READ)     = 0
mprotect(0xbd4000, 4096, PROT_READ)     = 0
mprotect(0x855000, 4096, PROT_READ)     = 0
munmap(0xb7f13000, 22893)               = 0
set_tid_address(0xb7f11728)             = 19676
set_robust_list(0xb7f11730, 0xc)        = 0
futex(0xbf8e5370, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0xbf8e5370, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, bf8e5380) = -1 ENOSYS (Function not implemented)
rt_sigaction(SIGRTMIN, {0xbc33b0, [], SA_RESTORER|SA_SIGINFO, 0xbcce60}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0xbc3840, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0xbcce60}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
uname({sys="Linux", node="mail.cibolo.us", ...}) = 0
brk(0)                                  = 0x89c1000
brk(0x89e2000)                          = 0x89e2000
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
open("/etc/nsswitch.conf", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=465, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f18000
read(3, "# /etc/nsswitch.conf\n#\n# Example"..., 4096) = 465
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0xb7f18000, 4096)                = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=22893, ...}) = 0
mmap2(NULL, 22893, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f13000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libnss_compat.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\16\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=30496, ...}) = 0
mmap2(NULL, 29268, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x254000
mmap2(0x25a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6) = 0x25a000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libnsl.so.1", O_RDONLY)      = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\2201\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=79676, ...}) = 0
mmap2(NULL, 92136, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb75000
mmap2(0xb88000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12) = 0xb88000
mmap2(0xb8a000, 6120, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb8a000
close(3)                                = 0
mprotect(0xb88000, 4096, PROT_READ)     = 0
mprotect(0x25a000, 4096, PROT_READ)     = 0
munmap(0xb7f13000, 22893)               = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=22893, ...}) = 0
mmap2(NULL, 22893, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f13000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libnss_nis.so.2", O_RDONLY)  = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\31\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=38504, ...}) = 0
mmap2(NULL, 37432, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x75f000
mmap2(0x767000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8) = 0x767000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libnss_files.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \32\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=42572, ...}) = 0
mmap2(NULL, 45772, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x284000
mmap2(0x28e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9) = 0x28e000
close(3)                                = 0
mprotect(0x28e000, 4096, PROT_READ)     = 0
mprotect(0x767000, 4096, PROT_READ)     = 0
munmap(0xb7f13000, 22893)               = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
fcntl64(3, F_GETFD)                     = 0x1 (flags FD_CLOEXEC)
_llseek(3, 0, [0], SEEK_CUR)            = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=1804, ...}) = 0
mmap2(NULL, 1804, PROT_READ, MAP_SHARED, 3, 0) = 0xb7f18000
_llseek(3, 1804, [1804], SEEK_SET)      = 0
munmap(0xb7f18000, 1804)                = 0
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
open("/etc/group", O_RDONLY|O_CLOEXEC)  = 3
_llseek(3, 0, [0], SEEK_CUR)            = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=836, ...}) = 0
mmap2(NULL, 836, PROT_READ, MAP_SHARED, 3, 0) = 0xb7f18000
_llseek(3, 836, [836], SEEK_SET)        = 0
munmap(0xb7f18000, 836)                 = 0
close(3)                                = 0
open("/dev/null", O_RDWR|O_LARGEFILE)   = 3
close(3)                                = 0
socket(PF_NETLINK, SOCK_RAW, 0)         = 3
bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(3, {sa_family=AF_NETLINK, pid=19676, groups=00000000}, [12]) = 0
time(NULL)                              = 1294097104
sendto(3, "\24\0\0\0\26\0\1\3\320Z\"M\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, 
msg_iov(1)=[{"<\0\0\0\24\0\2\0\320Z\"M\334L\0\0\2\10\200\376\1\0\0\0\10\0\1\0\177\0\0\1"..., 4096}], msg_controllen=0, 
msg_flags=0}, 0) = 240
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, 
msg_iov(1)=[{"@\0\0\0\24\0\2\0\320Z\"M\334L\0\0\n\200\200\376\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, 
msg_flags=0}, 0) = 64
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, 
msg_iov(1)=[{"\24\0\0\0\3\0\2\0\320Z\"M\334L\0\0\0\0\0\0\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
close(3)                                = 0
open("/etc/gai.conf", O_RDONLY)         = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2940, ...}) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=2940, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f18000
read(3, "# Configuration for getaddrinfo("..., 4096) = 2940
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0xb7f18000, 4096)                = 0
futex(0x251cd0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET6, sin6_port=htons(9418), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 
28) = 0
getsockname(3, {sa_family=AF_INET6, sin6_port=htons(47484), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_flowinfo=0, 
sin6_scope_id=0}, [28]) = 0
connect(3, {sa_family=AF_UNSPEC, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 16) = 0
connect(3, {sa_family=AF_INET, sin_port=htons(9418), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
getsockname(3, {sa_family=AF_INET6, sin6_port=htons(48606), inet_pton(AF_INET6, "::ffff:127.0.0.1", &sin6_addr), sin6_flowinfo=0, 
sin6_scope_id=0}, [28]) = 0
close(3)                                = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(9418), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
close(3)                                = 0
socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP) = 3
setsockopt(3, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0
bind(3, {sa_family=AF_INET6, sin6_port=htons(9418), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
listen(3, 5)                            = 0
fcntl64(3, F_GETFD)                     = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
open("/proc/sys/kernel/ngroups_max", O_RDONLY) = 4
read(4, "65536\n", 31)                  = 6
close(4)                                = 0
open("/etc/group", O_RDONLY|O_CLOEXEC)  = 4
_llseek(4, 0, [0], SEEK_CUR)            = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=836, ...}) = 0
mmap2(NULL, 836, PROT_READ, MAP_SHARED, 4, 0) = 0xb7f18000
_llseek(4, 836, [836], SEEK_SET)        = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=836, ...}) = 0
munmap(0xb7f18000, 836)                 = 0
close(4)                                = 0
setgroups32(1, [115])                   = 0
setgid32(115)                           = 0
setuid32(106)                           = 0
rt_sigaction(SIGCHLD, {0x804ae30, [CHLD], SA_RESTORER|SA_RESTART, 0x13a5d8}, {SIG_DFL, [], 0}, 8) = 0
waitpid(-1, 0xbf8e525c, WNOHANG)        = -1 ECHILD (No child processes)
poll([{fd=3, events=POLLIN}], 1, -1)    = -1 EINTR (Interrupted system call)
--- SIGINT (Interrupt) @ 0 (0) ---
+++ killed by SIGINT +++
vking@mail:/etc/sv$
=========================================================
JG
Jonathan Nieder· Jan 3, 2011, 23:55 UTC · re: John Griessen · lore

Re: git-daemon serving repos with repo.git/git-daemon-export-ok

John Griessen wrote:
> git version 1.7.2.3
Good.
> vking@mail:/etc/sv$ sv stat git-daemon
> fail: git-daemon: unable to change to service directory: file does not exist
Ah, you switched to running git daemon directly.
Show 5 quoted lines
> I can push to these repos with gitosis, and the permissions are:
>
> vking@mail:/srv/gitosis/repositories$ ll
> total 16
> drwxr-xr-x 7 gitosis gitosis 4096 Dec 30 12:32 extrudator.data.git

So the gitdaemon user (used by git-daemon-run) wouldn't be able to access them.

Show 5 quoted lines
> vking@mail:/etc/sv$ cat strace.out
> execve("/usr/lib/git-core/git-daemon",
> ["/usr/lib/git-core/git-daemon", "--verbose", "--strict-paths",
> "--user=git", "--group=gitosis", "/srv/gitosis/repositories"], [/*
> 10 vars */]) = 0

In this case simple --verbose output would probably be more useful. (That's what cat-ing /var/log/git-daemon/current would have given if git-daemon-run were still installed.)

Thanks for the strace. I should have mentioned that strace -f can help by following child processes, though that doesn't seem to be an issue here. It looks like another git-daemon process is running at the same time? (One can check with "netstat -t -a".)

John Griessen· Jan 4, 2011, 01:58 UTC · re: Jonathan Nieder · lore

Re: git-daemon serving repos with repo.git/git-daemon-export-ok

On 01/03/2011 05:55 PM, Jonathan Nieder wrote:
Show 8 quoted lines
>> I can push to these repos with gitosis, and the permissions are:
>>
>> vking@mail:/srv/gitosis/repositories$ ll
>> total 16
>> drwxr-xr-x 7 gitosis gitosis 4096 Dec 30 12:32 extrudator.data.git
>
> So the gitdaemon user (used by git-daemon-run) wouldn't be able to
> access them.

It would be able, since I used sudo strace -o strace.out /usr/lib/git-core/git-daemon --verbose --strict-paths --user=git --group=gitosis /srv/gitosis/repositories

git-daemon was asked to run as --user=git --group=gitosis, so it had read permissions and there was no user git-daemon anymore -- removed it from /etc/passwd.

Show 10 quoted lines
>
>> vking@mail:/etc/sv$ cat strace.out
>> execve("/usr/lib/git-core/git-daemon",
>> ["/usr/lib/git-core/git-daemon", "--verbose", "--strict-paths",
>> "--user=git", "--group=gitosis", "/srv/gitosis/repositories"], [/*
>> 10 vars */]) = 0
>
> In this case simple --verbose output would probably be more useful.
> (That's what cat-ing /var/log/git-daemon/current would have given
> if git-daemon-run were still installed.)
I tried this
sudo /usr/lib/git-core/git-daemon --verbose --strict-paths --user=git --group=gitosis /srv/gitosis/repositories  &>git-daemon-err.log
vking@mail:~$ cat git-daemon-err.log

and git-daemon-err.log was empty. Not the same as the /etc/sv/run script. Should I reinstall debian's git-daemon-run to do some tests?

Show 5 quoted lines
>
> Thanks for the strace.  I should have mentioned that strace -f can
> help by following child processes, though that doesn't seem to be
> an issue here.  It looks like another git-daemon process is running at
> the same time?  (One can check with "netstat -t -a".)
Nope, not as far as I can see.  What suggests that?

vking@mail:/etc/sv$ netstat -t -a Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 *:discard *:* LISTEN tcp 0 0 *:git *:* LISTEN tcp 0 0 localhost:mysql *:* LISTEN tcp 0 0 *:daytime *:* LISTEN tcp 0 0 localhost:sunrpc *:* LISTEN tcp 0 0 *:www *:* LISTEN tcp 0 0 localhost:690 *:* LISTEN tcp 0 0 cottagematic.com:domain *:* LISTEN tcp 0 0 mail.cibolo.us:domain *:* LISTEN tcp 0 0 localhost:domain *:* LISTEN tcp 0 0 *:ssh *:* LISTEN tcp 0 0 *:telnet *:* LISTEN tcp 0 0 localhost:postgresql *:* LISTEN tcp 0 0 *:smtp *:* LISTEN tcp 0 0 *:time *:* LISTEN tcp 0 0 *:ldap *:* LISTEN tcp 0 0 mail.cibolo.us:ssh cpe-66-68-104-159:47248 ESTABLISHED tcp 0 224 mail.cibolo.us:ssh cpe-66-68-104-159:47247 ESTABLISHED tcp6 0 0 *:pop3 *:* LISTEN tcp6 0 0 *:imap2 *:* LISTEN tcp6 0 0 *:ssh *:* LISTEN tcp6 0 0 *:imaps *:* LISTEN tcp6 0 0 *:pop3s *:* LISTEN tcp6 0 0 *:ldap *:* LISTEN tcp6 0 0 mail.cibolo.us:imaps cpe-66-68-104-159:58203 ESTABLISHED tcp6 0 0 mail.cibolo.us:imaps cpe-66-68-104-159:58226 ESTABLISHED tcp6 0 0 mail.cibolo.us:imaps cpe-66-68-104-159:48747 ESTABLISHED tcp6 0 0 mail.cibolo.us:imaps cpe-66-68-104-159:58175 ESTABLISHED tcp6 0 0 mail.cibolo.us:imaps cpe-66-68-104-159:58174 ESTABLISHED tcp6 0 0 mail.cibolo.us:imaps cpe-66-68-104-159:48951 ESTABLISHED tcp6 0 0 mail.cibolo.us:imaps cpe-66-68-104-159:52013 ESTABLISHED tcp6 0 0 mail.cibolo.us:imaps cpe-66-68-104-159:52012 ESTABLISHED tcp6 0 0 mail.cibolo.us:imaps cpe-66-68-104-159:52015 ESTABLISHED tcp6 0 0 mail.cibolo.us:imaps cpe-66-68-104-159:52014 ESTABLISHED tcp6 0 0 mail.cibolo.us:imaps cpe-66-68-104-159:47076 ESTABLISHED tcp6 0 0 mail.cibolo.us:imaps cpe-66-68-104-159:47079 ESTABLISHED tcp6 0 0 mail.cibolo.us:imaps cpe-66-68-104-159:47078 ESTABLISHED

John Griessen
Jonathan Nieder· Jan 4, 2011, 02:11 UTC · re: John Griessen · lore

Re: git-daemon serving repos with repo.git/git-daemon-export-ok

John Griessen wrote:
Show 6 quoted lines
> sudo /usr/lib/git-core/git-daemon --verbose --strict-paths --user=git
> --group=gitosis /srv/gitosis/repositories  &>git-daemon-err.log
>
> vking@mail:~$ cat git-daemon-err.log
>
> and git-daemon-err.log was empty.
Thanks for clarifying.
> Should I reinstall debian's git-daemon-run to do some tests?
Seems redundant next to the tests you've already done.
> On 01/03/2011 05:55 PM, Jonathan Nieder wrote:
>> an issue here.  It looks like another git-daemon process is running at
>> the same time?  (One can check with "netstat -t -a".)
>
> Nope, not as far as I can see.
I left out the "-p", sorry.  I'll be more careful in the future.
> What suggests that?
bind(3, {sa_family=AF_INET, sin_port=htons(9418), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
Jonathan Nieder· Jan 4, 2011, 03:09 UTC · re: John Griessen · lore

Re: git-daemon serving repos with repo.git/git-daemon-export-ok

John Griessen wrote:
> On 01/03/2011 05:55 PM, Jonathan Nieder wrote:
Show 8 quoted lines
>>> drwxr-xr-x 7 gitosis gitosis 4096 Dec 30 12:32 extrudator.data.git
>>
>> So the gitdaemon user (used by git-daemon-run) wouldn't be able to
>> access them.
>
> It would be able, since I used
> sudo strace -o strace.out /usr/lib/git-core/git-daemon --verbose
>	--strict-paths --user=git --group=gitosis /srv/gitosis/repositories

Also because the repositories are world readable. I don't know what I was thinking; I should get some sleep.

Thanks again for reporting and good luck.
Jonathan

← back to recent threads