diff --git a/etc/systemd/system/zfs-import-cache.service.in b/etc/systemd/system/zfs-import-cache.service.in index 5e5c6281c9..08c11698bc 100644 --- a/etc/systemd/system/zfs-import-cache.service.in +++ b/etc/systemd/system/zfs-import-cache.service.in @@ -14,6 +14,7 @@ ConditionPathIsDirectory=/sys/module/zfs [Service] Type=oneshot RemainAfterExit=yes +EnvironmentFile=-@initconfdir@/zfs ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN $ZPOOL_IMPORT_OPTS [Install] diff --git a/etc/systemd/system/zfs-import-scan.service.in b/etc/systemd/system/zfs-import-scan.service.in index d3c083f7e9..c37f70f13b 100644 --- a/etc/systemd/system/zfs-import-scan.service.in +++ b/etc/systemd/system/zfs-import-scan.service.in @@ -13,6 +13,7 @@ ConditionPathIsDirectory=/sys/module/zfs [Service] Type=oneshot RemainAfterExit=yes +EnvironmentFile=-@initconfdir@/zfs ExecStart=@sbindir@/zpool import -aN -o cachefile=none $ZPOOL_IMPORT_OPTS [Install] diff --git a/etc/systemd/system/zfs-mount.service.in b/etc/systemd/system/zfs-mount.service.in index 3ab82fb033..66d894923f 100644 --- a/etc/systemd/system/zfs-mount.service.in +++ b/etc/systemd/system/zfs-mount.service.in @@ -11,6 +11,7 @@ ConditionPathIsDirectory=/sys/module/zfs [Service] Type=oneshot RemainAfterExit=yes +EnvironmentFile=-@initconfdir@/zfs ExecStart=@sbindir@/zfs mount -a [Install] diff --git a/etc/systemd/system/zfs-scrub@.service.in b/etc/systemd/system/zfs-scrub@.service.in index bebe91d746..8ffffeb0cf 100644 --- a/etc/systemd/system/zfs-scrub@.service.in +++ b/etc/systemd/system/zfs-scrub@.service.in @@ -7,8 +7,9 @@ ConditionACPower=true ConditionPathIsDirectory=/sys/module/zfs [Service] +EnvironmentFile=-@initconfdir@/zfs ExecStart=/bin/sh -c '\ -if @sbindir@/zpool status %i | grep "scrub in progress"; then\ +if @sbindir@/zpool status %i | grep -q "scrub in progress"; then\ exec @sbindir@/zpool wait -t scrub %i;\ else exec @sbindir@/zpool scrub -w %i; fi' ExecStop=-/bin/sh -c '@sbindir@/zpool scrub -p %i 2>/dev/null || true' diff --git a/etc/systemd/system/zfs-share.service.in b/etc/systemd/system/zfs-share.service.in index 745077513c..263055e528 100644 --- a/etc/systemd/system/zfs-share.service.in +++ b/etc/systemd/system/zfs-share.service.in @@ -13,6 +13,7 @@ ConditionPathIsDirectory=/sys/module/zfs [Service] Type=oneshot RemainAfterExit=yes +EnvironmentFile=-@initconfdir@/zfs ExecStart=@sbindir@/zfs share -a [Install] diff --git a/etc/systemd/system/zfs-volume-wait.service.in b/etc/systemd/system/zfs-volume-wait.service.in index 4c77724d8b..110c0f5f52 100644 --- a/etc/systemd/system/zfs-volume-wait.service.in +++ b/etc/systemd/system/zfs-volume-wait.service.in @@ -8,6 +8,7 @@ ConditionPathIsDirectory=/sys/module/zfs [Service] Type=oneshot RemainAfterExit=yes +EnvironmentFile=-@initconfdir@/zfs ExecStart=@bindir@/zvol_wait [Install] diff --git a/etc/systemd/system/zfs-zed.service.in b/etc/systemd/system/zfs-zed.service.in index 008075138f..73a83e59e5 100644 --- a/etc/systemd/system/zfs-zed.service.in +++ b/etc/systemd/system/zfs-zed.service.in @@ -4,6 +4,7 @@ Documentation=man:zed(8) ConditionPathIsDirectory=/sys/module/zfs [Service] +EnvironmentFile=-@initconfdir@/zfs ExecStart=@sbindir@/zed -F Restart=on-abort