From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: pre-release [PATCH] git-service [v2] Date: Mon, 22 Aug 2016 11:03:41 +0300 Message-ID: <87fupxcjs2.fsf@gmail.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbkD0-0003B7-7M for guix-devel@gnu.org; Mon, 22 Aug 2016 04:03:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bbkCu-00062i-7z for guix-devel@gnu.org; Mon, 22 Aug 2016 04:03:49 -0400 Received: from mail-lf0-x231.google.com ([2a00:1450:4010:c07::231]:33588) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbkCu-00062Y-0P for guix-devel@gnu.org; Mon, 22 Aug 2016 04:03:44 -0400 Received: by mail-lf0-x231.google.com with SMTP id b199so71828826lfe.0 for ; Mon, 22 Aug 2016 01:03:43 -0700 (PDT) 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") 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: ng0 Cc: guix-devel 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=3D" (number->string (git-configuration-port config)) > + "--base-path=3D" (git-configuration-base-path config))) 1. This should be: "--port=3D" #$(number->string (git-configuration-port config)) "--base-path=3D" #$(git-configuration-base-path config))) Note =E2=80=98#$=E2=80=99 before expressions. Without it, these expression= s 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 =E2=80=98#$@ =E2=86=92 #$=E2=80=99. With #$@, the list (I mean git-co= mmand) is "spliced", so the result in "/gnu/store/...-shepherd-git.scm" will be: (make ... #:start (make-forkexec-constructor list (string-append "/gnu/store/=E2=80=A6" "/bin/gi= t") "daemon" "--syslog" "--informative-errors" "--port=3D" (number->string (git-configuration-port config)) "--base-path=3D" (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=3D9418 --base-path=3D/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. --=20 Alex