Archived
1
0
Fork 0

services/nfs: Replace nfs-version with nfs-versions.

Instead of accepting a string for just one protocol version accept a list of
supported versions.

* gnu/services/nfs.scm (<nfs-configuration>)[nfs-version]: Remove field and
replace...
[nfs-versions]: ...with this new field.
(nfs-shepherd-services): Pass as many "--nfs-version" options as there are
supported versions.
* doc/guix.texi (Network File System): Document nfs-versions.
This commit is contained in:
Ricardo Wurmus 2020-03-27 15:24:54 +01:00
parent 9483782a61
commit bc3fda5d2b
No known key found for this signature in database
GPG key ID: 197A5888235FACAC
2 changed files with 16 additions and 15 deletions

View file

@ -22233,9 +22233,9 @@ It has the following parameters:
@item @code{nfs-utils} (default: @code{nfs-utils}) @item @code{nfs-utils} (default: @code{nfs-utils})
The nfs-utils package to use. The nfs-utils package to use.
@item @code{nfs-version} (default: @code{#f}) @item @code{nfs-versions} (default: @code{'("4.2" "4.1" "4.0")})
If a string value is provided, the @command{rpc.nfsd} daemon will be If a list of string values is provided, the @command{rpc.nfsd} daemon
limited to supporting the given version of the NFS protocol. will be limited to supporting the given versions of the NFS protocol.
@item @code{exports} (default: @code{'()}) @item @code{exports} (default: @code{'()})
This is a list of directories the NFS server should export. Each entry This is a list of directories the NFS server should export. Each entry

View file

@ -245,8 +245,8 @@
nfs-configuration? nfs-configuration?
(nfs-utils nfs-configuration-nfs-utils (nfs-utils nfs-configuration-nfs-utils
(default nfs-utils)) (default nfs-utils))
(nfs-version nfs-configuration-nfs-version (nfs-versions nfs-configuration-nfs-versions
(default #f)) ; string (default '("4.2" "4.1" "4.0")))
(exports nfs-configuration-exports (exports nfs-configuration-exports
(default '())) (default '()))
(rpcmountd-port nfs-configuration-rpcmountd-port (rpcmountd-port nfs-configuration-rpcmountd-port
@ -270,7 +270,7 @@
(define (nfs-shepherd-services config) (define (nfs-shepherd-services config)
"Return a list of <shepherd-service> for the NFS daemons with CONFIG." "Return a list of <shepherd-service> for the NFS daemons with CONFIG."
(match-record config <nfs-configuration> (match-record config <nfs-configuration>
(nfs-utils nfs-version exports (nfs-utils nfs-versions exports
rpcmountd-port rpcstatd-port nfsd-port nfsd-threads rpcmountd-port rpcstatd-port nfsd-port nfsd-threads
pipefs-directory debug) pipefs-directory debug)
(list (shepherd-service (list (shepherd-service
@ -323,15 +323,16 @@
(requirement '(/proc/fs/nfsd rpc.statd networking)) (requirement '(/proc/fs/nfsd rpc.statd networking))
(start (start
#~(lambda _ #~(lambda _
(zero? (system* #$(file-append nfs-utils "/sbin/rpc.nfsd") (zero? (apply system* #$(file-append nfs-utils "/sbin/rpc.nfsd")
#$@(if (member 'nfsd debug) (list
'("--debug") #$@(if (member 'nfsd debug)
'()) '("--debug")
"--port" #$(number->string nfsd-port) '())
#$@(if nfs-version "--port" #$(number->string nfsd-port)
'("--nfs-version" nfs-version) #$@(map (lambda (version)
'()) (string-append "--nfs-version=" version))
#$(number->string nfsd-threads))))) nfs-versions)
#$(number->string nfsd-threads))))))
(stop (stop
#~(lambda _ #~(lambda _
(zero? (zero?