git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Problem with post-receive hook

From
Bill Lear <rael@zopyra.com>
Date
Feb 1, 2008, 19:01 UTC
Message-ID
<18339.27767.633833.374795@lisa.zopyra.com>

I am having trouble getting the contributed post-receive hook to work, which worked just fine the last time I tried it. I am using the latest code from the git repo directly and have also tried the 1.5.3.8 version.

I am running the git-daemon through xinetd, and it is configured like so:

% cat /etc/xinetd.d/git-daemon
# description: The git server offers access to git repositories
service git
{
        disable         = no
        type            = UNLISTED
        port            = 9418
        socket_type     = stream
        wait            = no
        user            = rael
        server          = /opt/git/bin/git-daemon
        server_args     = --enable=receive-pack --verbose --syslog --inetd --export-all --base-path=/repos/git
        log_on_failure  += USERID
}

I have a test repo in /repos/git/fun, and I can clone it, and push to it successfully. I have configured the config file in /repos/git/fun like so:

% cat /repos/git/fun/config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = true
        legacyheaders = false
        logallrefupdates = true
[repack]
        usedeltabaseoffset = true
[hooks]
        mailinglist = rael@zopyra.com

and have ensured that the hook /repos/git/config/fun/hooks/post-receive is executable.

I have run it from the command line and it has printed out what I expected it to, but for some reason when the git daemon gets a pack, it does not seem to execute the hook. I have looked through the git daemon code in daemon.c, and the receive-pack code, and I see nothing obvious that has changed since the last time I looked at it.

I have verified that the git daemon works to upload the packs (I push changes, go somewhere else, clone and the changes are there; also, it shows the upload in the syslog file /var/log/messages), and I'm just at a loss. The message file says, for example:

Feb 1 11:25:47 zopyra git-daemon: [31240] Connection from 192.168.10.23:41527 Feb 1 11:25:47 zopyra git-daemon: [31240] Extended attributes (12 bytes) exist <host=zopyra> Feb 1 11:25:47 zopyra git-daemon: [31240] Request upload-pack for '/fun' Feb 1 11:25:47 zopyra xinetd[2382]: EXIT: git status=0 pid=31240 duration=0(sec)

so, nothing seems amiss here.
Have I missed something really stupid?
Bill
Message 1 of 1 in “Problem with post-receive hook”
  1. Bill LearFeb 1, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.