Bug#975873: Please hook zfs-share up to nfs-kernel-server stop+start

Andrei POPESCU andreimpopescu at gmail.com
Sat Jan 9 08:46:15 GMT 2021


On Jo, 26 nov 20, 14:06:15, Trent W. Buck wrote:
> Package: zfsutils-linux
> Version: 0.8.4-1~bpo10+1
> Severity: minor
> 
> I'm not sure who is 'at fault' here, or where the fix belongs.
> 
> The problem I ran into was this:
> 
>   1. I zfs set sharenfs (not /etc/exports), because
>      it makes config management a little easier (exports(5) lacks a "drop-in" dir).
> 
>   2. During an apt update, needrestart asks to restart NFS.
> 
>   3. I tell needrestart "sure, go ahead".
> 
>   4. All my NFS exports are gone!
> 
> I can reproduce the symptoms with stop+start, but not restart:
> 
>     root at odin:~# exportfs -s
>     /srv/old-disks  goll.lan(ro,async,wdelay,root_squash,no_subtree_check,mountpoint,sec=sys,ro,secure,root_squash,no_all_squash)
>     root at odin:~# systemctl restart nfs-kernel-server
>     root at odin:~# exportfs -s
>     /srv/old-disks  goll.lan(ro,async,wdelay,root_squash,no_subtree_check,mountpoint,sec=sys,ro,secure,root_squash,no_all_squash)
>     root at odin:~# systemctl stop nfs-kernel-server
>     root at odin:~# systemctl start nfs-kernel-server
>     root at odin:~# exportfs -s
>     [UH OH, PROBLEM!]
>     root at odin:~# zfs share -a
>     root at odin:~# exportfs -s
>     /srv/old-disks  goll.lan(ro,async,wdelay,root_squash,no_subtree_check,mountpoint,sec=sys,ro,secure,root_squash,no_all_squash)

I can reproduce this as well.

> Can ZFS hook NFS, or vice-versa, so this problem flow stops happening?
> This has already bitten me twice! :-(

If my understanding of systemd.unit(5) is correct this works as expected 
when using the PartOf= directive: zfs-share is stopped or restarted 
together with nfs-service, but not started.

Maybe the needrestart Maintainers have a better idea what is going on 
here?

(adding to Cc: and attaching zfs-share.service for their convenience)


Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser
-------------- next part --------------
[Unit]
Description=ZFS file system shares
Documentation=man:zfs(8)
After=nfs-server.service nfs-kernel-server.service
After=smb.service
Before=rpc-statd-notify.service
Wants=zfs-mount.service
After=zfs-mount.service
PartOf=nfs-server.service nfs-kernel-server.service
PartOf=smb.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=-/bin/rm -f /etc/dfs/sharetab
ExecStart=/sbin/zfs share -a

[Install]
WantedBy=zfs.target
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20210109/2ad6fb69/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list