Skip to content

Commit d32d25c

Browse files
authored
Fix zfs-mount.service failure on boot
The mount(8) command will helpfully try to resolve any device name which is passed in. It does this by applying some simple heuristics before passing it along to the registered mount helper. Normally this fine. However, one of these heuristics is to prepend the current working directory to the passed device name. If that resulting directory name exists mount(8) will perform the mount(2) system call and never invoke the helper utility. Since the cwd for systemd when running as the system instance is the root directory the default mount points created by zfs(8) can cause a mount failure. This change avoids the issue by explicitly setting the cwd to a different path when performing the mount. Signed-off-by: Brian Behlendorf <[email protected]> Closes #5719
1 parent 97dde92 commit d32d25c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

etc/systemd/system/zfs-mount.service.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Before=local-fs.target
1111
Type=oneshot
1212
RemainAfterExit=yes
1313
ExecStart=@sbindir@/zfs mount -a
14+
WorkingDirectory=-/sbin/
1415

1516
[Install]
1617
WantedBy=zfs-share.service

0 commit comments

Comments
 (0)