mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
systemd zfs-import.target and documentation
zfs-import-{cache,scan}.service must complete before any mounting of
filesystems can occur. To simplify this dependency, create a target
that is reached After (in the systemd sense) the pool is imported.
Additionally, recommend that legacy zfs mounts use the option
x-systemd.requires=zfs-import.target
to codify this requirement.
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
Closes #6764
This commit is contained in:
committed by
Brian Behlendorf
parent
ca85d69097
commit
5c2552c564
@@ -7,6 +7,7 @@ systemdunit_DATA = \
|
||||
zfs-import-scan.service \
|
||||
zfs-mount.service \
|
||||
zfs-share.service \
|
||||
zfs-import.target \
|
||||
zfs.target
|
||||
|
||||
EXTRA_DIST = \
|
||||
@@ -15,6 +16,7 @@ EXTRA_DIST = \
|
||||
$(top_srcdir)/etc/systemd/system/zfs-import-scan.service.in \
|
||||
$(top_srcdir)/etc/systemd/system/zfs-mount.service.in \
|
||||
$(top_srcdir)/etc/systemd/system/zfs-share.service.in \
|
||||
$(top_srcdir)/etc/systemd/system/zfs-import.target.in \
|
||||
$(top_srcdir)/etc/systemd/system/zfs.target.in \
|
||||
$(top_srcdir)/etc/systemd/system/50-zfs.preset.in
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ After=systemd-udev-settle.service
|
||||
After=cryptsetup.target
|
||||
After=systemd-remount-fs.service
|
||||
Before=dracut-mount.service
|
||||
Before=zfs-import.target
|
||||
ConditionPathExists=@sysconfdir@/zfs/zpool.cache
|
||||
|
||||
[Service]
|
||||
@@ -16,5 +17,4 @@ ExecStartPre=/sbin/modprobe zfs
|
||||
ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN
|
||||
|
||||
[Install]
|
||||
WantedBy=zfs-mount.service
|
||||
WantedBy=zfs.target
|
||||
WantedBy=zfs-import.target
|
||||
|
||||
@@ -6,6 +6,7 @@ Requires=systemd-udev-settle.service
|
||||
After=systemd-udev-settle.service
|
||||
After=cryptsetup.target
|
||||
Before=dracut-mount.service
|
||||
Before=zfs-import.target
|
||||
ConditionPathExists=!@sysconfdir@/zfs/zpool.cache
|
||||
|
||||
[Service]
|
||||
@@ -15,5 +16,4 @@ ExecStartPre=/sbin/modprobe zfs
|
||||
ExecStart=@sbindir@/zpool import -aN -o cachefile=none
|
||||
|
||||
[Install]
|
||||
WantedBy=zfs-mount.service
|
||||
WantedBy=zfs.target
|
||||
WantedBy=zfs-import.target
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
[Unit]
|
||||
Description=ZFS pool import target
|
||||
|
||||
[Install]
|
||||
WantedBy=zfs-mount.service
|
||||
WantedBy=zfs.target
|
||||
@@ -3,8 +3,7 @@ Description=Mount ZFS filesystems
|
||||
Documentation=man:zfs(8)
|
||||
DefaultDependencies=no
|
||||
After=systemd-udev-settle.service
|
||||
After=zfs-import-cache.service
|
||||
After=zfs-import-scan.service
|
||||
After=zfs-import.target
|
||||
After=systemd-remount-fs.service
|
||||
Before=local-fs.target
|
||||
|
||||
|
||||
Reference in New Issue
Block a user