[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pre-release [PATCH] git-service [v2]
From: |
Alex Kost |
Subject: |
Re: pre-release [PATCH] git-service [v2] |
Date: |
Mon, 22 Aug 2016 11:03:41 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
ng0 (2016-08-11 18:55 +0300) wrote:
> ng0 <address@hidden> writes:
>
>> As I wrote yesterday in freenode, disregard this patch. I
>> succeeded and currently am debugging the VM.
>
> I had it working at some point, but only to find out that I am passing
> something wrong in the service.
> Can someone take a look at this service and help me out?
Hi, I didn't try this service, but I see 2 mistakes in the code.
[...]
> +(define (git-shepherd-service config)
> + "Return a <shepherd-service> for git with CONFIG."
> + (define git (git-configuration-git config))
> +
> + (define git-command
> + #~(list
> + (string-append #$git "/bin/git") "daemon" "--syslog"
> + "--informative-errors"
> + "--port=" (number->string (git-configuration-port config))
> + "--base-path=" (git-configuration-base-path config)))
1. This should be:
"--port=" #$(number->string (git-configuration-port config))
"--base-path=" #$(git-configuration-base-path config)))
Note ‘#$’ before expressions. Without it, these expressions will stay
the same in the final making service code (see below).
> + (define requires
> + '(networking syslogd))
> +
> + (list (shepherd-service
> + (documentation "Git daemon server for git repositories")
> + (requirement requires)
> + (provision '(git))
> + (start #~(make-forkexec-constructor address@hidden))
2. This should be:
(start #~(make-forkexec-constructor #$git-command))
Note ‘#$@ → #$’. With #$@, the list (I mean git-command) is "spliced",
so the result in "/gnu/store/...-shepherd-git.scm" will be:
(make <service>
...
#:start
(make-forkexec-constructor list
(string-append "/gnu/store/…" "/bin/git")
"daemon" "--syslog" "--informative-errors"
"--port=" (number->string
(git-configuration-port config))
"--base-path="
(git-configuration-base-path config))
...)
While it should be: (make-forkexec-constructor (list ...))
Also I have a question about the final command to start git daemon. It
would look like this:
git daemon --syslog --informative-errors --port=9418
--base-path=/var/git/repositories
Is it intentional? I mean "/var/git/repositories" does not exist and
you don't create it at activation time, so the service (with the default
'base-path') will fail anyway.
But you create "/var/run/git-daemon". Is it really needed? I know
nothing about "git daemon", but IIUC it starts successfully without this
directory.
--
Alex
- Re: pre-release [PATCH] git-service [v2], ng0, 2016/08/11
- Re: pre-release [PATCH] git-service [v2], ng0, 2016/08/19
- Re: pre-release [PATCH] git-service [v2],
Alex Kost <=
- Re: pre-release [PATCH] git-service [v2], ng0, 2016/08/25
- Re: pre-release [PATCH] git-service [v2], Alex Kost, 2016/08/26
- Re: pre-release [PATCH] git-service [v2], ng0, 2016/08/27
- Re: pre-release [PATCH] git-service [v2], Alex Kost, 2016/08/27
- Re: pre-release [PATCH] git-service [v2], ng0, 2016/08/27
- Re: pre-release [PATCH] git-service [v2], ng0, 2016/08/27