mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-14 04:00:31 +03:00
1d8a71b603
Use the same method used in zfs-load-key. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Llewelyn Trahaearn <WoefulDerelict@GMail.com> Signed-off-by: Matthew Thode <mthode@mthode.org> Closes #7089
20 lines
587 B
SYSTEMD
20 lines
587 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
|
|
Before=zfs-import.target
|
|
ConditionPathExists=!@sysconfdir@/zfs/zpool.cache
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
RemainAfterExit=yes
|
|
ExecStartPre=/sbin/modprobe zfs
|
|
ExecStart=@sbindir@/zpool import -aN -o cachefile=none
|
|
ExecStartPost=/bin/bash -c "/bin/systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs | /bin/awk '$1 != \"-\" {print; exit}')"
|
|
|
|
[Install]
|
|
WantedBy=zfs-import.target
|