From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddI5a-0004L9-VU for guix-patches@gnu.org; Thu, 03 Aug 2017 11:31:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddI5W-0008F5-3L for guix-patches@gnu.org; Thu, 03 Aug 2017 11:31:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:37482) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ddI5V-0008EV-V0 for guix-patches@gnu.org; Thu, 03 Aug 2017 11:31:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ddI5V-0001zk-OH for guix-patches@gnu.org; Thu, 03 Aug 2017 11:31:01 -0400 Subject: [bug#27855] [PATCH] gnu: Add rsync service. Resent-Message-ID: From: Oleg Pykhalov Message-ID: <87k22kzn4k.fsf@gmail.com> References: <20170727220151.2116-1-go.wigust@gmail.com> <20170728231747.5eae3af9@cbaines.net> <874ltvh5d6.fsf@gmail.com> <20170729125554.29836b28@cbaines.net> <87r2wszni8.fsf@gmail.com> Date: Thu, 03 Aug 2017 18:29:52 +0300 In-Reply-To: <87r2wszni8.fsf@gmail.com> (Oleg Pykhalov's message of "Thu, 03 Aug 2017 18:20:31 +0300") MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Christopher Baines Cc: 27855@debbugs.gnu.org --=-=-= Content-Type: text/plain And I probably need to add this patch too. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-services-rsync-Clean-up-code.patch Content-Description: Add group >From 468ebe35b2a2c75752661d1591d9e7f387aff83e Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Thu, 3 Aug 2017 18:28:03 +0300 Subject: [PATCH] services: rsync: Clean up code. * gnu/services/rsync.scm: Clean up. --- gnu/services/rsync.scm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/gnu/services/rsync.scm b/gnu/services/rsync.scm index e1a014a63..0612a0ea6 100644 --- a/gnu/services/rsync.scm +++ b/gnu/services/rsync.scm @@ -69,12 +69,13 @@ (define (rsync-account config) "Return the user accounts and user groups for CONFIG." - (let ((rsync-user (rsync-configuration-user config))) + (let ((rsync-user (rsync-configuration-user config)) + (rsync-group (rsync-configuration-group config))) (list (user-group (name "rsyncd") (system? #t)) (user-account (name rsync-user) (system? #t) - (group rsync-user) + (group rsync-group) (comment "rsyncd privilege separation user") (home-directory "/var/run/rsyncd") (shell #~(string-append #$shadow "/sbin/nologin")))))) @@ -84,11 +85,12 @@ #~(begin (use-modules (guix build utils)) (let ((share-directory #$(rsync-configuration-share-path config)) - (user (getpw #$(rsync-configuration-user config)))) + (user (getpw #$(rsync-configuration-user config))) + (group (getpw #$(rsync-configuration-group config)))) (and=> share-directory mkdir-p) (chown share-directory (passwd:uid user) - (group:gid user))))) + (group:gid group))))) (define (rsync-config-file config) "Return the rsync configuration file corresponding to CONFIG." @@ -115,7 +117,8 @@ (let* ((rsync (rsync-configuration-package config)) (pid-file (rsync-configuration-pid-file config)) (port (rsync-configuration-port-number config)) - (user (if (> port 1024) (rsync-configuration-user config) "root"))) + (user (if (> port 1024) (rsync-configuration-user config) "root")) + (group (if (> port 1024) (rsync-configuration-group config) "root"))) (list (shepherd-service (provision '(rsync)) (documentation "Run rsync daemon.") @@ -125,7 +128,7 @@ "--daemon") #:pid-file #$pid-file #:user #$user - #:group #$user)) + #:group #$group)) (stop #~(make-kill-destructor)))))) (define rsync-service-type -- 2.13.3 --=-=-=--