Skip to content

Commit d411ea2

Browse files
authored
Add templated [email protected]
Runs `zfs mount -R <dataset>` at boot, after `zfs mount -a`. Intended to replace `mountpoint=legacy` in certain mount setups. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Meriel Luna Mittelbach <[email protected]> Closes #17483
1 parent c98a393 commit d411ea2

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

contrib/debian/openzfs-zfsutils.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ lib/systemd/system/zfs-import-scan.service
88
lib/systemd/system/zfs-import.target
99
lib/systemd/system/zfs-load-key.service
1010
lib/systemd/system/zfs-mount.service
11+
lib/systemd/system/[email protected]
1112
lib/systemd/system/[email protected]
1213
lib/systemd/system/[email protected]
1314
lib/systemd/system/[email protected]

etc/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ systemdunit_DATA = \
5656
%D%/systemd/system/zfs-import-scan.service \
5757
%D%/systemd/system/zfs-import.target \
5858
%D%/systemd/system/zfs-mount.service \
59+
%D%/systemd/system/[email protected] \
5960
%D%/systemd/system/[email protected] \
6061
%D%/systemd/system/[email protected] \
6162
%D%/systemd/system/[email protected] \

etc/systemd/system/[email protected]

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[Unit]
2+
Description=Mount ZFS filesystem %I
3+
Documentation=man:zfs(8)
4+
DefaultDependencies=no
5+
After=systemd-udev-settle.service
6+
After=zfs-import.target
7+
After=zfs-mount.service
8+
After=systemd-remount-fs.service
9+
Before=local-fs.target
10+
ConditionPathIsDirectory=/sys/module/zfs
11+
12+
# This merely tells the service manager
13+
# that unmounting everything undoes the
14+
# effect of this service. No extra logic
15+
# is ran as a result of these settings.
16+
Conflicts=umount.target
17+
Before=umount.target
18+
19+
[Service]
20+
Type=oneshot
21+
RemainAfterExit=yes
22+
EnvironmentFile=-@initconfdir@/zfs
23+
ExecStart=@sbindir@/zfs mount -R %I
24+
25+
[Install]
26+
WantedBy=zfs.target

rpm/generic/zfs.spec.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ support for unlocking datasets on user login.
388388

389389
%if 0%{?_systemd}
390390
%define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --with-systemdmodulesloaddir=%{_modulesloaddir} --with-systemdgeneratordir=%{_systemdgeneratordir} --disable-sysvinit
391-
%define systemd_svcs zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-share.service zfs-zed.service zfs.target zfs-import.target zfs-volume-wait.service zfs-volumes.target
391+
%define systemd_svcs zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-[email protected] zfs-share.service zfs-zed.service zfs.target zfs-import.target zfs-volume-wait.service zfs-volumes.target
392392
%else
393393
%define systemd --enable-sysvinit --disable-systemd
394394
%endif

0 commit comments

Comments
 (0)