Bug#975873: Acknowledgement (Please hook zfs-share up to nfs-kernel-server stop+start)
Am 09.01.21 um 12:32 schrieb Andrei POPESCU: Additionally zfsutils-linux is in contrib, so even if it does work reliably it's likely unsuitable to apply such a fix to the nfs-kernel-server package. You could ship a drop-in snippet in zfsutils-linux extending the nfs-kernel-server service. In my limited testing a WantedBy=nfs-server.service seems to do the trick (somehow I was under the impression this can be used only with targets). Targets are typically used to group together services and to generalise things. But WantedBy=nfs-server.service is perfectly valid. It has the downside to be tied to the nfs-server.service name. Still curious why a stop/start is triggered by needrestart though. That, and why needrestart uses stop/start instead of restart. OpenPGP_signature Description: OpenPGP digital signature
Bug#975873: Acknowledgement (Please hook zfs-share up to nfs-kernel-server stop+start)
On Sb, 09 ian 21, 10:39:38, Michael Biebl wrote: > On Thu, 26 Nov 2020 14:15:23 +1100 "Trent W. Buck" > wrote: > > This quick-and-dirty fix seems to work for me: > > > > root@odin:~# systemctl cat nfs-kernel-server > > # /lib/systemd/system/nfs-server.service > > [...] > > > > # /etc/systemd/system/nfs-server.service.d/zfsutils-linux.conf > > # If you configure NFS exports in "zfs set sharenfs", > > # this will remove all your NFS shares! > > # > > # systemctl stop nfs-kernel-server > > # systemctl start nfs-kernel-server > > # > > # This is an attempt at a quick fix. > > [Service] > > ExecStartPost=/sbin/zfs share -a > > > > Thank you for reading and apologies in case the Cc: was inappropriate. At first I thought this is a problem with the PartOf directive, but then I noticed the man page explicitly mentions restart and stop only, but not start. > Hm, I assume this triggers the mount of ZFS volumes. > While I understand the motivation for the stop+start nfs-server.service > case, what happens during boot? > Does this have the potential to trigger the mount at a time when not > all dependencies are ready? Probably, e.g. in case nfs-server is started before the ZFS pool is ready. Additionally zfsutils-linux is in contrib, so even if it does work reliably it's likely unsuitable to apply such a fix to the nfs-kernel-server package. In my limited testing a WantedBy=nfs-server.service seems to do the trick (somehow I was under the impression this can be used only with targets). Still curious why a stop/start is triggered by needrestart though. Kind regards, Andrei -- http://wiki.debian.org/FAQsFromDebianUser signature.asc Description: PGP signature
Bug#975873: Acknowledgement (Please hook zfs-share up to nfs-kernel-server stop+start)
On Thu, 26 Nov 2020 14:15:23 +1100 "Trent W. Buck" wrote: > This quick-and-dirty fix seems to work for me: > > root@odin:~# systemctl cat nfs-kernel-server > # /lib/systemd/system/nfs-server.service > [...] > > # /etc/systemd/system/nfs-server.service.d/zfsutils-linux.conf > # If you configure NFS exports in "zfs set sharenfs", > # this will remove all your NFS shares! > # > # systemctl stop nfs-kernel-server > # systemctl start nfs-kernel-server > # > # This is an attempt at a quick fix. > [Service] > ExecStartPost=/sbin/zfs share -a > > Hm, I assume this triggers the mount of ZFS volumes. While I understand the motivation for the stop+start nfs-server.service case, what happens during boot? Does this have the potential to trigger the mount at a time when not all dependencies are ready? signature.asc Description: This is a digitally signed message part
Bug#975873: Acknowledgement (Please hook zfs-share up to nfs-kernel-server stop+start)
This quick-and-dirty fix seems to work for me: root@odin:~# systemctl cat nfs-kernel-server # /lib/systemd/system/nfs-server.service [...] # /etc/systemd/system/nfs-server.service.d/zfsutils-linux.conf # If you configure NFS exports in "zfs set sharenfs", # this will remove all your NFS shares! # # systemctl stop nfs-kernel-server # systemctl start nfs-kernel-server # # This is an attempt at a quick fix. [Service] ExecStartPost=/sbin/zfs share -a