From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] gnu: Use a directory owned by ntpd user for drift file. Date: Fri, 09 Sep 2016 11:30:41 +0200 Message-ID: <87lgz18loe.fsf@gnu.org> References: <1473277956-22799-1-git-send-email-jmd@gnu.org> 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]:39584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biI94-0000ZV-Rs for guix-devel@gnu.org; Fri, 09 Sep 2016 05:30:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biI8z-0004zh-TO for guix-devel@gnu.org; Fri, 09 Sep 2016 05:30:49 -0400 In-Reply-To: (Vincent Legoll's message of "Thu, 8 Sep 2016 08:57:57 +0200") 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: Vincent Legoll Cc: guix-devel , John Darrington Hi, Vincent Legoll skribis: >> +(define (ntp-service-activation config) >> + "Return the activation gexp for config" >> + #~(begin >> + (use-modules (guix build utils)) >> + >> + (define %user >> + (getpw "ntpd")) >> + >> + (let ((directory "/var/run/ntpd")) >> + (mkdir-p directory) >> + (chown directory (passwd:uid %user) (passwd:gid %user))))) >> + > > Excuse my scheme-newbie questions, but > > - why did you use %user (I thought %s were for kind of global vars) ? In the context of this gexp it=E2=80=99s a global variable. > - why did you use define and not put it in the let just below ? Idon't see > it being used elsewhere... Both styles are OK, though putting it in the =E2=80=98let=E2=80=99 would ha= ve made it more concise, indeed. :-) Ludo=E2=80=99.