mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-31 23:06:59 +01:00
services: nfs: Allow rpcbind-service-type to be extended.
* gnu/services/nfs.scm (rpcbind-service-type): Rewrite using SERVICE-TYPE to add ability to extend the service.
This commit is contained in:
parent
981ce38937
commit
ba1808d5e7
1 changed files with 27 additions and 14 deletions
|
@ -56,8 +56,7 @@ (define-record-type* <rpcbind-configuration>
|
||||||
(default #t)))
|
(default #t)))
|
||||||
|
|
||||||
(define rpcbind-service-type
|
(define rpcbind-service-type
|
||||||
(shepherd-service-type
|
(let ((proc
|
||||||
'rpcbind
|
|
||||||
(lambda (config)
|
(lambda (config)
|
||||||
(define rpcbind
|
(define rpcbind
|
||||||
(rpcbind-configuration-rpcbind config))
|
(rpcbind-configuration-rpcbind config))
|
||||||
|
@ -73,6 +72,20 @@ (define rpcbind-command
|
||||||
|
|
||||||
(start #~(make-forkexec-constructor #$rpcbind-command))
|
(start #~(make-forkexec-constructor #$rpcbind-command))
|
||||||
(stop #~(make-kill-destructor))))))
|
(stop #~(make-kill-destructor))))))
|
||||||
|
(service-type
|
||||||
|
(name 'rpcbind)
|
||||||
|
(extensions
|
||||||
|
(list (service-extension shepherd-root-service-type
|
||||||
|
(compose list proc))))
|
||||||
|
;; We use the extensions feature to allow other services to automatically
|
||||||
|
;; configure and start this service. Only one value can be provided. We
|
||||||
|
;; override it with the value returned by the extending service.
|
||||||
|
(compose identity)
|
||||||
|
(extend (lambda (config values)
|
||||||
|
(match values
|
||||||
|
((first . rest) first)
|
||||||
|
(_ config))))
|
||||||
|
(default-value (rpcbind-configuration)))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue