From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Darrington Subject: [PATCH] gnu: Add rpc-daemon service Date: Mon, 5 Sep 2016 21:22:11 +0200 Message-ID: <1473103331-25267-1-git-send-email-jmd@gnu.org> References: <871t11kr86.fsf@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]:51243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgzTK-00014D-V7 for guix-devel@gnu.org; Mon, 05 Sep 2016 15:22:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgzTG-000595-Ok for guix-devel@gnu.org; Mon, 05 Sep 2016 15:22:21 -0400 In-Reply-To: <871t11kr86.fsf@gnu.org> 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: guix-devel@gnu.org Cc: John Darrington Try this patch * gnu/services/nfs.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- doc/guix.texi | 16 +++++++++++++++ gnu/local.mk | 1 + gnu/services/nfs.scm | 55 ++++++++++++++++++++++++++++++++++++++++++++++= ++++++ 3 files changed, 72 insertions(+) create mode 100644 gnu/services/nfs.scm diff --git a/doc/guix.texi b/doc/guix.texi index b6ca34a..7e3fbfc 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9975,6 +9975,22 @@ directories are created when the service is activa= ted. @node Various Services @subsubsection Various Services =20 +@cindex rpcbind +@subsubheading Rpcbind Service + +The @code{(gnu services rpcbind)} module provides the following service. + +@deffn {Scheme Procedure} rpcbind-service [#:rpcbind rpcbind] @ + [#:warm-start? #t] +Return a service that runs @command{rpcbind}, a server which converts RP= C +program numbers to universal addresses. + +Optionally, the package where the daemon is to be found, @var{rpcbind}, = may be +specified. +If @var{warm-start?} is true (the default), then it will read a state fi= le on +startup and thus reload state information saved saved by the previous in= stance. +@end deffn + @cindex lirc @subsubheading Lirc Service =20 diff --git a/gnu/local.mk b/gnu/local.mk index 50363ef..9d284da 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -389,6 +389,7 @@ GNU_SYSTEM_MODULES =3D \ %D%/services/mail.scm \ %D%/services/mcron.scm \ %D%/services/networking.scm \ + %D%/services/nfs.scm \ %D%/services/shepherd.scm \ %D%/services/herd.scm \ %D%/services/spice.scm \ diff --git a/gnu/services/nfs.scm b/gnu/services/nfs.scm new file mode 100644 index 0000000..6084f69 --- /dev/null +++ b/gnu/services/nfs.scm @@ -0,0 +1,55 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2016 John Darrington +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (a= t +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services nfs) + #:use-module (gnu) + #:use-module (gnu services shepherd) + #:use-module (gnu packages onc-rpc) + #:use-module (guix) + #:use-module (guix records) + #:export (rpcbind-service-type + rpcbind-configuration + rpcbind-configuration?)) + +(define-record-type* + rpcbind-configuration make-rpcbind-configuration + rpcbind-configuration? + (rpcbind rpcbind-configuration-rpcbind + (default rpcbind)) + (warm-start? rpcbind-configuration-warm-start? + (default #t))) + +(define (rpcbind-shepherd-service config) + (define pkg + (rpcbind-configuration-rpcbind config)) + + (define rpcbind-command + #~(list (string-append #$pkg "/bin/rpcbind") "-f" + #$@(if (rpcbind-configuration-warm-start? config) '("-w") '(= )))) + =20 + (list (shepherd-service + (provision '(rpcbind-daemon)) + (requirement '(networking)) + (start #~(make-forkexec-constructor #$rpcbind-command)) + (stop #~(make-kill-destructor))))) + +(define rpcbind-service-type + (service-type + (name 'rpcbind) + (extensions (list (service-extension shepherd-root-service-type + rpcbind-shepherd-service))))) --=20 2.1.4