aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Piecuch <[email protected]>2022-02-22 20:59:11 +0000
committerGitHub <[email protected]>2022-02-22 12:59:11 -0800
commitccdcc1dbe8b2b741194cdbc5b81bdb8b58cc7142 (patch)
treef858b15d170b6241b82f23b4e4238a2cac04b3db
parent7454ca413cb7464c9dc055fe6b9727c177a3a73a (diff)
systemd: read initconfdir
Systemd units do not read @initconfdir@ but refer to variables defined there, also a minor fixup in zfs-scrub service file. Reviewed-by: Ahelenia ZiemiaƄska <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Damian Szuberski <[email protected]> Signed-off-by: Krzysztof Piecuch <[email protected]> Closes #12946
-rw-r--r--etc/systemd/system/zfs-import-cache.service.in1
-rw-r--r--etc/systemd/system/zfs-import-scan.service.in1
-rw-r--r--etc/systemd/system/zfs-mount.service.in1
-rw-r--r--etc/systemd/system/[email protected]3
-rw-r--r--etc/systemd/system/zfs-share.service.in1
-rw-r--r--etc/systemd/system/zfs-volume-wait.service.in1
-rw-r--r--etc/systemd/system/zfs-zed.service.in1
7 files changed, 8 insertions, 1 deletions
diff --git a/etc/systemd/system/zfs-import-cache.service.in b/etc/systemd/system/zfs-import-cache.service.in
index 5e5c6281c..08c11698b 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 d3c083f7e..c37f70f13 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 3ab82fb03..66d894923 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/[email protected] b/etc/systemd/system/[email protected]
index bebe91d74..8ffffeb0c 100644
--- a/etc/systemd/system/[email protected]
+++ b/etc/systemd/system/[email protected]
@@ -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 745077513..263055e52 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 4c77724d8..110c0f5f5 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 008075138..73a83e59e 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