zfsonlinux/zfs — pull request #2066 by Lalufu (2014-01-20 21:06:39+00:00)
Title: Add systemd unit files for ZFS startup

This adds systemd unit files replacing the functionality offered by
the SysV init script found in etc/init.d.

It has been developed and tested on Fedora 19.

Four unit files and one target are offered.

zfs-module.service:
Load the ZFS kernel module
zfs-import.service:
Import pools from /etc/zfs/zpool.cache. This unit will wait for
udev to settle.
zfs-mount.service:
Mount ZFS native filesystems. It contains a dependency to be loaded
before local-fs.target.
zfs-share.service:
Share NFS/SMB filesystems. This unit contains a dependency that
will cause it to be restarted whenever the smb or nfs-server unit
is restarted, restoring the shares added.
zfs.target:
This target pulls in the other units in order to start ZFS. It's
the only unit that can be enabled/disabled, all other services
are static and pulled in by dependencies. It will honour zfs=off
and zfs=no options on the kernel command line.

A preset file is present that will enable zfs.target by default.