From mboxrd@z Thu Jan 1 00:00:00 1970 From: iyzsong@member.fsf.org (=?utf-8?B?5a6L5paH5q2m?=) Subject: Re: [PATCH] gnu: service: Add git-service. Date: Sat, 01 Oct 2016 07:49:36 +0800 Message-ID: <8737khlzhr.fsf@member.fsf.org> References: <87poor4tgx.fsf@we.make.ritual.n0.is> <878tvf7jfd.fsf@igalia.com> <878tvfr6ec.fsf@we.make.ritual.n0.is> <87eg57tk6t.fsf@we.make.ritual.n0.is> <87eg5666y4.fsf@igalia.com> <874m62pjjx.fsf@we.make.ritual.n0.is> <87bn0a4fsb.fsf@igalia.com> <871t16qh83.fsf@we.make.ritual.n0.is> <878tudpxgx.fsf@we.make.ritual.n0.is> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bq7Yp-00035l-Lj for guix-devel@gnu.org; Fri, 30 Sep 2016 19:49:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bq7Yk-00059w-Ms for guix-devel@gnu.org; Fri, 30 Sep 2016 19:49:46 -0400 Received: from mail2.openmailbox.org ([62.4.1.33]:34716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bq7Yk-00058j-G9 for guix-devel@gnu.org; Fri, 30 Sep 2016 19:49:42 -0400 In-Reply-To: <878tudpxgx.fsf@we.make.ritual.n0.is> (ng0@we.make.ritual.n0.is's message of "Tue, 27 Sep 2016 08:18:22 +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@gnu.org ng0 writes: >> From d1d7eb59ca53833098cea2d6eddaa59f1494b579 Mon Sep 17 00:00:00 2001 >> From: ng0 >> Date: Fri, 8 Jul 2016 15:42:55 +0000 >> Subject: [PATCH] gnu: services: Add git-service. >> >> * gnu/services/version-control.scm: New file, create it. >> (git-service): New Procedures. >> (git-service-type): New variable. >> * doc/guix.texi: Add documentation. I think it should be: * doc/guix.text (Services)(Version Control): New section. > [...] >> +(define %git-accounts >> + ;; User account and groups for git-daemon. >> + (list (user-group >> + (name "git") >> + (system? #t)) >> + (user-account >> + (name "git") >> + (system? #t) >> + (group "git") >> + (comment "Shepherd created user for the git-daemon service") >> + (home-directory "/var/git") I think it doesn't need a home directory. >> + (shell #~(string-append #$shadow "/bin/git-shell"))))) Use 'nologin' should be enough, according to `man git-shell', it's for SSH access. Also, it seems this 'git' user is not used anywhere, it should be passed as the '--user' argument to 'git daemon' or as '#:user' to 'make-forkexec-constructor'. >> + >> +(define (git-activation config) >> + "Return the activation gexp for CONFIG." >> + #~(begin (use-modules (guix build utils)) >> + ;; Create the default base-directory, see `man git daemon'. >> + (mkdir-p "/var/git/repositories"))) This should create the 'git-configuration-base-directory' of config, and make sure it's readable by the 'git' user. >> +(define* (git-service #:key >> + (git git) >> + (base-directory "/var/git/repositories") >> + (user-directory? #f) >> + (user-directory? "") >> + (directory? #f) >> + (directory "") >> + (port 9418) >> + (pid-file? #t) >> + (pid-file "/var/run/git-daemon.pid") >> + (max-connections 32)) This should just accept a object, and document it in the manaual (no need to make detail comments in the git-command, which I think a mention to `man git-daemon' is fine there). For testing, I guess 'git clone git://localhost/xxx' in the VM is enough. And the patch doesn't apply for me, can you send an update one?