all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: ng0 <ng0@we.make.ritual.n0.is>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: pre-release [PATCH] git-service [v2]
Date: Mon, 22 Aug 2016 11:03:41 +0300	[thread overview]
Message-ID: <87fupxcjs2.fsf@gmail.com> (raw)
In-Reply-To: <87vaz7cnbs.fsf@we.make.ritual.n0.is> (ng0@we.make.ritual.n0.is's message of "Thu, 11 Aug 2016 15:55:19 +0000")

ng0 (2016-08-11 18:55 +0300) wrote:

> ng0 <ng0@we.make.ritual.n0.is> 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 #$@git-command))

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

  parent reply	other threads:[~2016-08-22  8:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08 15:53 pre-release [PATCH] git-service ng0
2016-07-08 18:24 ` Thompson, David
2016-07-08 20:41   ` Ricardo Wurmus
2016-07-09  1:08     ` ng0
2016-07-13 10:23     ` ng0
2016-07-13 16:37     ` pre-release [PATCH] git-service [v2] ng0
2016-07-14  9:07       ` ng0
2016-08-11 15:55         ` ng0
2016-08-19  9:02           ` ng0
2016-08-22  8:03           ` Alex Kost [this message]
2016-08-25  9:55             ` ng0
2016-08-26  4:50               ` Alex Kost
2016-08-27 15:39                 ` ng0
2016-08-27 20:09                   ` Alex Kost
2016-08-27 20:44                     ` ng0
2016-08-28  0:04                       ` ng0

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fupxcjs2.fsf@gmail.com \
    --to=alezost@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ng0@we.make.ritual.n0.is \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.