From 01a961fab523a3e7e58f9f30dfd8dab7421df2c8 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 31 Jan 2017 15:42:24 -0800 Subject: [PATCH] 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 --- etc/systemd/system/zfs-mount.service.in | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/systemd/system/zfs-mount.service.in b/etc/systemd/system/zfs-mount.service.in index 0664fd9e7665..36dc3be507f9 100644 --- a/etc/systemd/system/zfs-mount.service.in +++ b/etc/systemd/system/zfs-mount.service.in @@ -11,6 +11,7 @@ Before=local-fs.target Type=oneshot RemainAfterExit=yes ExecStart=@sbindir@/zfs mount -a +WorkingDirectory=-/sbin/ [Install] WantedBy=zfs-share.service