From mboxrd@z Thu Jan 1 00:00:00 1970 From: ng0 Subject: Re: pre-release [PATCH] git-service [v2] Date: Thu, 25 Aug 2016 09:55:10 +0000 Message-ID: <87r39dgold.fsf@we.make.ritual.n0.is> References: <87zipsgm8g.fsf@we.make.ritual.n0.is> <87r3b33ls5.fsf@elephly.net> <87d1mhxzmu.fsf_-_@we.make.ritual.n0.is> <878tx4k2pb.fsf@we.make.ritual.n0.is> <87vaz7cnbs.fsf@we.make.ritual.n0.is> <87fupxcjs2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcrNT-0004j5-Gh for guix-devel@gnu.org; Thu, 25 Aug 2016 05:55:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcrNR-0001iX-4i for guix-devel@gnu.org; Thu, 25 Aug 2016 05:55:14 -0400 Received: from mithlond.libertad.in-berlin.de ([2001:67c:1400:2490::1]:57032 helo=beleriand.n0.is) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcrNQ-0001iA-Py for guix-devel@gnu.org; Thu, 25 Aug 2016 05:55:13 -0400 In-Reply-To: <87fupxcjs2.fsf@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Alex Kost Cc: guix-devel 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 writes: > ng0 (2016-08-11 18:55 +0300) wrote: > >> ng0 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 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 > ... > #: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