mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 19:19:32 +03:00
a8c5bcb5de
When a system boots the zfs-mount.service and the zfs-share.service can start simultaneously. What may be unclear is that sharing a filesystem will first mount the filesystem if it's not already mounted. This means that both service can race to mount the same fileystem. This race can result in a SEGFAULT or EBUSY conditions. This change explicitly defines the start ordering between the two services such that the zfs-mount.service is solely responsible for mounting filesystems eliminating the race between "zfs mount -a" and "zfs share -a" commands. Reviewed-by: Sebastien Roy <sebastien.roy@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: George Wilson <george.wilson@delphix.com> Closes #9083
20 lines
438 B
SYSTEMD
20 lines
438 B
SYSTEMD
[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=@sbindir@/zfs share -a
|
|
|
|
[Install]
|
|
WantedBy=zfs.target
|