mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
services: nfs: Move activation snippet out of line.
* gnu/services/nfs.scm (%nfs-activation): New variable. (nfs-service-type)[extensions]: Refer to %NFS-ACTIVATION.
This commit is contained in:
parent
a55472955d
commit
e28770df71
1 changed files with 23 additions and 19 deletions
|
@ -360,31 +360,35 @@ (define (nfs-shepherd-services config)
|
|||
#t))
|
||||
(respawn? #f)))))
|
||||
|
||||
(define %nfs-activation
|
||||
(with-imported-modules '((guix build utils))
|
||||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
|
||||
(system* "mount" "-t" "nfsd"
|
||||
"nfsd" "/proc/fs/nfsd")
|
||||
|
||||
(mkdir-p "/var/lib/nfs")
|
||||
;; directory containing monitor list
|
||||
(mkdir-p "/var/lib/nfs/sm")
|
||||
;; Needed for client recovery tracking
|
||||
(mkdir-p "/var/lib/nfs/v4recovery")
|
||||
(let ((user (getpw "nobody")))
|
||||
(chown "/var/lib/nfs"
|
||||
(passwd:uid user)
|
||||
(passwd:gid user))
|
||||
(chown "/var/lib/nfs/v4recovery"
|
||||
(passwd:uid user)
|
||||
(passwd:gid user)))
|
||||
#t)))
|
||||
|
||||
(define nfs-service-type
|
||||
(service-type
|
||||
(name 'nfs)
|
||||
(extensions
|
||||
(list
|
||||
(service-extension shepherd-root-service-type nfs-shepherd-services)
|
||||
(service-extension activation-service-type
|
||||
(const #~(begin
|
||||
(use-modules (guix build utils))
|
||||
(system* "mount" "-t" "nfsd"
|
||||
"nfsd" "/proc/fs/nfsd")
|
||||
|
||||
(mkdir-p "/var/lib/nfs")
|
||||
;; directory containing monitor list
|
||||
(mkdir-p "/var/lib/nfs/sm")
|
||||
;; Needed for client recovery tracking
|
||||
(mkdir-p "/var/lib/nfs/v4recovery")
|
||||
(let ((user (getpw "nobody")))
|
||||
(chown "/var/lib/nfs"
|
||||
(passwd:uid user)
|
||||
(passwd:gid user))
|
||||
(chown "/var/lib/nfs/v4recovery"
|
||||
(passwd:uid user)
|
||||
(passwd:gid user)))
|
||||
#t)))
|
||||
(service-extension activation-service-type (const %nfs-activation))
|
||||
(service-extension etc-service-type
|
||||
(lambda (config)
|
||||
`(("exports"
|
||||
|
|
Loading…
Reference in a new issue