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: Add rpc-daemon service Date: Sat, 03 Sep 2016 16:11:53 +0200 Message-ID: <871t11kr86.fsf@gnu.org> References: <1472884782-27956-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]:35311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgBft-0006yv-CB for guix-devel@gnu.org; Sat, 03 Sep 2016 10:12:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgBfp-0000KQ-6I for guix-devel@gnu.org; Sat, 03 Sep 2016 10:12:01 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgBfp-0000KE-2k for guix-devel@gnu.org; Sat, 03 Sep 2016 10:11:57 -0400 In-Reply-To: <1472884782-27956-1-git-send-email-jmd@gnu.org> (John Darrington's message of "Sat, 3 Sep 2016 08:39:42 +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: John Darrington Cc: guix-devel@gnu.org John Darrington skribis: > * gnu/services/nfs: New file. ^^ > * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. For the final patch, please make sure to mention it in guix.texi. > --- /dev/null > +++ b/gnu/services/nfs.scm Missing license. > @@ -0,0 +1,25 @@ > +(define-module (gnu services nfs) > + #:use-module (gnu) > + #:use-module (gnu services shepherd) > + #:use-module (gnu packages onc-rpc) > + #:use-module (guix) > + #:export (rpc-service)) > + > +(define (rpc-shepherd-service config) ; Config is ignored > + (list (shepherd-service > + (provision '(rpc-daemon)) > + (requirement '(networking)) > + (start #~(make-forkexec-constructor > + (list (string-append #$rpcbind "/bin/rpcbind") "-d" "= -f"))) > + (stop #~(make-kill-destructor))))) > + > +(define rpc-service-type > + (service-type > + (name 'rpc) > + (extensions (list (service-extension shepherd-root-service-type > + rpc-shepherd-service))))) In this case, you can simply write: (define rpcbind-service-type (shepherd-service-type 'rpcbind (lambda (config) (shepherd-service =E2=80=A6)))) I think the service should be called =E2=80=9Crpcbind=E2=80=9D, and not =E2= =80=9Crpc=E2=80=9D (there are other ONC=C2=A0RPC and NFS daemons, such as mountd and statd, so we need to use clear names.) > +(define* (rpc-service config) > + "Run the rpc daemon. Config is ignored." > + (service rpc-service-type config)) There=E2=80=99s at least one bit of config needed: the =E2=80=98rpcbind=E2= =80=99 package to use. So I would write it as: (service rpcbind-service-type rpcbind) and then honor this argument. Also, the preferred way now is to expose service-type objects and not provide procedures like the one above. So you can omit this procedure and instead make sure to #:export (rpcbind-service-type). Could you send an updated patch? If you=E2=80=99re willing to play a bit, it would be nice to have a system = test that spawns a GuixSD with this service, and then makes sure that, say, the =E2=80=98rpcinfo=E2=80=99 program is able to connect to the daemon. Bu= t that=E2=80=99s bonus. :-) Thanks! Ludo=E2=80=99.