mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-18 02:20:59 +03:00
f1de1600d1
This is a minor change to the systemd service templates that verifies the zfs kernel module is loaded by the kernel prior to attempting to import any zpool. The services check for the presence of /sys/module/zfs which indicates the zfs is module is loaded. This uses the systemd built-in check ConditionPathIsDirectory. Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Matthew Thode <prometheanfire@gentoo.org> Signed-off-by: Jonathon Fernyhough <jonathon.fernyhough@york.ac.uk> Closes #10663
20 lines
477 B
SYSTEMD
20 lines
477 B
SYSTEMD
[Unit]
|
|
Description=Import ZFS pools by device scanning
|
|
Documentation=man:zpool(8)
|
|
DefaultDependencies=no
|
|
Requires=systemd-udev-settle.service
|
|
After=systemd-udev-settle.service
|
|
After=cryptsetup.target
|
|
After=multipathd.target
|
|
Before=zfs-import.target
|
|
ConditionPathExists=!@sysconfdir@/zfs/zpool.cache
|
|
ConditionPathIsDirectory=/sys/module/zfs
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
RemainAfterExit=yes
|
|
ExecStart=@sbindir@/zpool import -aN -o cachefile=none
|
|
|
|
[Install]
|
|
WantedBy=zfs-import.target
|