]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/systemd/system/zfs-import-cache.service.in
Allow modprobe to fail when called within systemd
[FreeBSD/FreeBSD.git] / etc / systemd / system / zfs-import-cache.service.in
1 [Unit]
2 Description=Import ZFS pools by cache file
3 Documentation=man:zpool(8)
4 DefaultDependencies=no
5 Requires=systemd-udev-settle.service
6 After=systemd-udev-settle.service
7 After=cryptsetup.target
8 After=systemd-remount-fs.service
9 Before=zfs-import.target
10 ConditionPathExists=@sysconfdir@/zfs/zpool.cache
11
12 [Service]
13 Type=oneshot
14 RemainAfterExit=yes
15 ExecStartPre=-/sbin/modprobe zfs
16 ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN
17 ExecStartPost=/bin/bash -c "/bin/systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs | /bin/awk '$1 != \"-\" {print; exit}')"
18
19 [Install]
20 WantedBy=zfs-import.target