mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00: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 @@
|
||||||
#t))
|
#t))
|
||||||
(respawn? #f)))))
|
(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
|
(define nfs-service-type
|
||||||
(service-type
|
(service-type
|
||||||
(name 'nfs)
|
(name 'nfs)
|
||||||
(extensions
|
(extensions
|
||||||
(list
|
(list
|
||||||
(service-extension shepherd-root-service-type nfs-shepherd-services)
|
(service-extension shepherd-root-service-type nfs-shepherd-services)
|
||||||
(service-extension activation-service-type
|
(service-extension activation-service-type (const %nfs-activation))
|
||||||
(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 etc-service-type
|
(service-extension etc-service-type
|
||||||
(lambda (config)
|
(lambda (config)
|
||||||
`(("exports"
|
`(("exports"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue