Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systemd configuration fixes #4699

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion etc/modules-load.d/zfs.conf.in
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
zfs
# Always load kernel modules at boot. The default behavior is to load the
# kernel modules in the zfs-import-*.service or when blkid(8) detects a pool.
#zfs
7 changes: 6 additions & 1 deletion etc/systemd/system/50-zfs.preset.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# ZFS is enabled by default
enable zfs.*
enable zfs-import-cache.service
disable zfs-import-scan.service
enable zfs-mount.service
enable zfs-share.service
enable zfs-zed.service
enable zfs.target
5 changes: 5 additions & 0 deletions etc/systemd/system/zfs-import-cache.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ DefaultDependencies=no
Requires=systemd-udev-settle.service
After=systemd-udev-settle.service
After=cryptsetup.target
After=systemd-remount-fs.service
Before=dracut-mount.service
ConditionPathExists=@sysconfdir@/zfs/zpool.cache

Expand All @@ -12,3 +13,7 @@ Type=oneshot
RemainAfterExit=yes
ExecStartPre=/sbin/modprobe zfs
ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN

[Install]
WantedBy=zfs-mount.service
WantedBy=zfs.target
6 changes: 5 additions & 1 deletion etc/systemd/system/zfs-import-scan.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ ConditionPathExists=!@sysconfdir@/zfs/zpool.cache
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/sbin/modprobe zfs
ExecStart=@sbindir@/zpool import -d /dev/disk/by-id -aN
ExecStart=@sbindir@/zpool import -aN -o cachefile=none

[Install]
WantedBy=zfs-mount.service
WantedBy=zfs.target
8 changes: 5 additions & 3 deletions etc/systemd/system/zfs-mount.service.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
[Unit]
Description=Mount ZFS filesystems
DefaultDependencies=no
Wants=zfs-import-cache.service
Wants=zfs-import-scan.service
Requires=systemd-udev-settle.service
After=systemd-udev-settle.service
After=zfs-import-cache.service
After=zfs-import-scan.service
After=systemd-remount-fs.service
Before=local-fs.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@sbindir@/zfs mount -a

[Install]
WantedBy=zfs-share.service
WantedBy=zfs.target
4 changes: 3 additions & 1 deletion etc/systemd/system/zfs-share.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Description=ZFS file system shares
After=nfs-server.service nfs-kernel-server.service
After=smb.service
After=zfs-mount.service
Requires=zfs-mount.service
PartOf=nfs-server.service nfs-kernel-server.service
PartOf=smb.service

Expand All @@ -12,3 +11,6 @@ Type=oneshot
RemainAfterExit=yes
ExecStartPre=-@bindir@/rm /etc/dfs/sharetab
ExecStart=@sbindir@/zfs share -a

[Install]
WantedBy=zfs.target
1 change: 1 addition & 0 deletions etc/systemd/system/zfs-zed.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Restart=on-abort

[Install]
Alias=zed.service
WantedBy=zfs.target
3 changes: 0 additions & 3 deletions etc/systemd/system/zfs.target.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
[Unit]
Description=ZFS startup target
Requires=zfs-mount.service
Requires=zfs-share.service
Wants=zfs-zed.service

[Install]
WantedBy=multi-user.target