all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Darrington <jmd@gnu.org>
To: guix-devel@gnu.org
Cc: John Darrington <jmd@gnu.org>
Subject: [PATCH 2/2] gnu: Add GSSD and Pipefs services
Date: Sat, 10 Sep 2016 21:18:03 +0200	[thread overview]
Message-ID: <1473535083-5326-2-git-send-email-jmd@gnu.org> (raw)
In-Reply-To: <1473535083-5326-1-git-send-email-jmd@gnu.org>

* 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>
   rpcbind-configuration make-rpcbind-configuration
@@ -52,3 +63,54 @@
 
       (start #~(make-forkexec-constructor #$rpcbind-command))
       (stop #~(make-kill-destructor))))))
+
+\f
+
+(define-record-type* <pipefs-configuration>
+  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))))))))
+
+\f
+
+(define-record-type* <gss-configuration>
+  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

  reply	other threads:[~2016-09-10 19:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-10 19:18 [PATCH 1/2] doc: "Various Services" -> "Miscellaneous Services" John Darrington
2016-09-10 19:18 ` John Darrington [this message]
2016-09-13 11:45   ` [PATCH 2/2] gnu: Add GSSD and Pipefs services Ludovic Courtès
2016-09-13 13:53     ` [PATCH 2/2] gnu: Add GSSD and Pipefs services (Usage of @var) John Darrington
2016-09-14 14:42       ` Ludovic Courtès
2016-09-21 18:29         ` John Darrington
2016-09-24  3:03           ` Ludovic Courtès
2016-09-15  5:06     ` "filesystem" vs. "file system" John Darrington
2016-09-15 20:27       ` Ludovic Courtès
2016-09-25  8:21     ` [PATCH] gnu: Add NFS related services John Darrington
2016-09-30 12:02       ` Ludovic Courtès
2016-09-30 14:35         ` John Darrington
2016-10-06  2:08         ` [PATCH (3)] gnu: Add NFS related services (moved idmap.conf out of /etc, added texinfo markup to documentation, s/dir/directory) John Darrington
2016-10-06 19:49           ` Ludovic Courtès
2016-10-08 10:19             ` John Darrington
2016-10-09  5:47             ` John Darrington
2016-10-11  6:37             ` [PATCH (4)] gnu: Add NFS related services. (minor improvements to documentation; Added test to ensure that pipefs mount/umount succeeded() John Darrington
2016-10-11 20:30               ` Ludovic Courtès
2016-09-13 11:28 ` [PATCH 1/2] doc: "Various Services" -> "Miscellaneous Services" Ludovic Courtès
2016-09-13 12:18   ` John Darrington
2016-09-13 12:31     ` Alex Sassmannshausen
2016-09-13 17:10     ` Leo Famulari
2016-09-13 17:42       ` John Darrington
2016-09-13 17:53         ` Leo Famulari
2016-09-13 21:57     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473535083-5326-2-git-send-email-jmd@gnu.org \
    --to=jmd@gnu.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.