From: ng0 <ng0@we.make.ritual.n0.is>
To: Alex Kost <alezost@gmail.com>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: pre-release [PATCH] git-service [v2]
Date: Thu, 25 Aug 2016 09:55:10 +0000 [thread overview]
Message-ID: <87r39dgold.fsf@we.make.ritual.n0.is> (raw)
In-Reply-To: <87fupxcjs2.fsf@gmail.com>
Hi,
thanks for finding the errors. I applied your suggestions but the
service still goes into respawn loop when the VM boots. Do you have any
idea why this could happen?
Alex Kost <alezost@gmail.com> writes:
> 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
--
ng0
For non-prism friendly talk find me on http://www.psyced.org
next prev parent reply other threads:[~2016-08-25 9:55 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
2016-08-25 9:55 ` ng0 [this message]
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r39dgold.fsf@we.make.ritual.n0.is \
--to=ng0@we.make.ritual.n0.is \
--cc=alezost@gmail.com \
--cc=guix-devel@gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).