From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Darrington Subject: [PATCH 2/2] gnu: Add GSSD and Pipefs services Date: Sat, 10 Sep 2016 21:18:03 +0200 Message-ID: <1473535083-5326-2-git-send-email-jmd@gnu.org> References: <1473535083-5326-1-git-send-email-jmd@gnu.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1binnG-000328-Pu for guix-devel@gnu.org; Sat, 10 Sep 2016 15:18:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1binnD-0000m4-K2 for guix-devel@gnu.org; Sat, 10 Sep 2016 15:18:26 -0400 In-Reply-To: <1473535083-5326-1-git-send-email-jmd@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 * gnu/services/nfs.scm (pipefs-service-type): New Variable, (gss-service-type): New Variable. --- doc/guix.texi | 48 +++++++++++++++++++++++++++++++++++---- gnu/services/nfs.scm | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 107 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 9f57744..f812a81 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -219,6 +219,7 @@ Services * Database Services:: SQL databases. * Mail Services:: IMAP, POP3, SMTP, and all that. * Web Services:: Web servers. +* NFS Services:: NFS related services. * Miscellaneous Services:: Other services. Defining Services @@ -7561,6 +7562,7 @@ declaration. * Database Services:: SQL databases. * Mail Services:: IMAP, POP3, SMTP, and all that. * Web Services:: Web servers. +* NFS Services:: NFS Related Serivices. * Miscellaneous Services:: Other services. @end menu @@ -10091,15 +10093,49 @@ directories are created when the service is activated. @end deffn -@node Miscellaneous Services -@subsubsection Miscellaneous Services +@node NFS Services +@subsubsection NFS Services +@cindex nfs + +The @code{(gnu services nfs)} module provides the following services, +which are most commonly used in relation to mouting or exporting NFS +filesystems. + +@subsubheading GSS Daemon Service +@cindex gssd +@cindex gss + +@defvr {Scheme Variable} gss-service-type +A service type for the RPC Global Security System (GSS) daemon. +@end defvr + +@deftp {Data Type} gss-configuration +Data type representing the configuration of the RPC GSS Daemon service. +This type has the following parameters: +@table @asis +@item @code{nfs-utils} (default: @code{nfs-utils}) +The package in which the @command{rpc.gssd} command is to be found. + +@end table +@end deftp + + +@subsubheading Pipefs Pseudo Filesystem +@cindex pipefs +@cindex rpc_pipefs +@defvr {Scheme Variable} pipefs-service-type +A service type for the pipefs pseudo filesystem. +@end defvr + +@deftp {Data Type} pipefs-configuration +Data type representing the configuration of the pipefs service. +There are no configurable parameters to this type. +@end deftp @subsubheading RPC Bind Service @cindex rpcbind -The @code{(gnu services nfs)} module provides the following: - @defvr {Scheme Variable} rpcbind-service-type A service type for the RPC portmapper daemon. @end defvr @@ -10119,6 +10155,10 @@ instance. @end table @end deftp +@node Miscellaneous Services +@subsubsection Miscellaneous Services + + @cindex lirc @subsubheading Lirc Service diff --git a/gnu/services/nfs.scm b/gnu/services/nfs.scm index 82713d8..0fa613a 100644 --- a/gnu/services/nfs.scm +++ b/gnu/services/nfs.scm @@ -20,11 +20,22 @@ #:use-module (gnu) #:use-module (gnu services shepherd) #:use-module (gnu packages onc-rpc) + #:use-module (gnu packages linux) #:use-module (guix) #:use-module (guix records) + #:use-module (ice-9 match) + #:use-module (gnu build file-systems) #:export (rpcbind-service-type rpcbind-configuration - rpcbind-configuration?)) + rpcbind-configuration? + + pipefs-service-type + pipefs-configuration + pipefs-configuration? + + gss-service-type + gss-configuration + gss-configuration?)) (define-record-type* rpcbind-configuration make-rpcbind-configuration @@ -52,3 +63,54 @@ (start #~(make-forkexec-constructor #$rpcbind-command)) (stop #~(make-kill-destructor)))))) + + + +(define-record-type* + pipefs-configuration make-pipefs-configuration + pipefs-configuration?) + +(define pipefs-service-type + (shepherd-service-type + 'pipefs + (lambda (config) + (with-imported-modules '((gnu build file-systems) + (guix build bournish)) + (define pipefs-dir "/var/lib/nfs/rpc_pipefs") + + (shepherd-service + (documentation "Mount the pipefs pseudo filesystem.") + (provision '(rpc-pipefs)) + + (start #~(lambda () + (mkdir-p #$pipefs-dir) + (mount "rpc_pipefs" #$pipefs-dir "rpc_pipefs"))) + (stop #~(lambda (pid . args) + (umount #$pipefs-dir MNT_DETACH)))))))) + + + +(define-record-type* + gss-configuration make-gss-configuration + gss-configuration? + (nfs-utils gss-configuration-gss + (default nfs-utils))) + +(define gss-service-type + (shepherd-service-type + 'gss + (lambda (config) + (define pkg + (gss-configuration-gss config)) + + (define gss-command + #~(list (string-append #$pkg "/sbin/rpc.gssd") "-f")) + + (shepherd-service + (documentation "Start the RPC GSS daemon.") + (requirement '(rpcbind-daemon rpc-pipefs)) + (provision '(gss-daemon)) + + (start #~(make-forkexec-constructor #$gss-command)) + (stop #~(make-kill-destructor)))))) + -- 2.1.4