GNU bug report logs - #45692
[PATCH 0/4] Even Better ZFS Support on Guix

Previous Next

Package: guix-patches;

Reported by: raid5atemyhomework <raid5atemyhomework <at> protonmail.com>

Date: Wed, 6 Jan 2021 15:53:01 UTC

Severity: normal

Tags: patch

Merged with 45643, 45703

Done: raid5atemyhomework <raid5atemyhomework <at> protonmail.com>

Bug is archived. No further changes may be made.

Full log


Message #74 received at 45692 <at> debbugs.gnu.org (full text, mbox):

From: raid5atemyhomework <raid5atemyhomework <at> protonmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 宋文武 <iyzsong <at> outlook.com>,
 "45692 <at> debbugs.gnu.org" <45692 <at> debbugs.gnu.org>
Subject: Re: bug#45692: [PATCH 0/4] Even Better ZFS Support on Guix
Date: Wed, 10 Feb 2021 14:46:43 +0000

> Why do we need to extend with symbols?
>
> In general it’s much clearer if extensions receive only one type of
> object (<file-system> records in this case). It’s also best to avoid
> passing around symbolic names (that’s why we extend with <file-system>
> records rather than with Shepherd service names or whatever.)

For this case, how would it be done?

ZFS file system, on other operating systems and distributions, is documented as automatically mounting filesystems, without management in an `fstab` or similar file, because the intent is that you would make lots of filesystems for various uses and managing an `fstab` would be too onerous.  Thus, ZFS file system expects to mount multiple file systems with a single `zfs mount -a` command at startup.

Would the below sketch be acceptable?

```scheme
; gnu/system/file-systems.scm
(define-record-type* file-system #;...
  #;...
  (has-fstab-entry?   file-system-has-fstab-entry?  (default #t)))

;...
; gnu/services/base,scm

(define file-system-service-type
  (service-type
    #;...
    (extensions
      (list #;...
            (service-extension fstab-service-type
                               (lambda (file-systems)
                                 (filter file-system-has-fstab-entry?
                                         file-systems)))
            #;...))
    #;...))

;...
; gnu/services/file-systems.scm

(define zfs-service-type
  (service-type
     #;...
     (extensions (list #;...
                       (service-extension file-system-service-type
                                          (const (list (file-system
                                                         (device "dummy")
                                                         (mount-point "zfs/*")
                                                         (has-fstab-entry? #f)))))))
    #;...))
```

Then there will be a Shepherd service providing `file-system-zfs/*` which would perform `zfs mount -a -l` on `start` and `zfs unmount -a -f` on `stop`.

Would that be acceptable?  I am wary of this since it creates a dummy file-system and needs an additional field on every `file-system` record, one which is *only* used by ZFS.  I feel the `file-system-target-service-type` is more generic and does not use trickery.

Thanks
raid5atemyhomework




This bug report was last modified 3 years and 120 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.