summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Thode <[email protected]>2018-01-30 23:58:19 +0000
committerBrian Behlendorf <[email protected]>2018-01-30 15:58:19 -0800
commit1d8a71b603769214a73bc9720107c4bd97206bff (patch)
tree47053146f646dbe79464f3a31fa269210460f9e1
parentbee7e4ff12c7170671606bcea33a6eef6cad5d58 (diff)
remove pools without a bootfs from BOOTFS variable
Use the same method used in zfs-load-key. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Llewelyn Trahaearn <[email protected]> Signed-off-by: Matthew Thode <[email protected]> Closes #7089
-rw-r--r--etc/systemd/system/zfs-import-cache.service.in2
-rw-r--r--etc/systemd/system/zfs-import-scan.service.in2
2 files changed, 2 insertions, 2 deletions
diff --git a/etc/systemd/system/zfs-import-cache.service.in b/etc/systemd/system/zfs-import-cache.service.in
index 3665b1eb4..308ced69d 100644
--- a/etc/systemd/system/zfs-import-cache.service.in
+++ b/etc/systemd/system/zfs-import-cache.service.in
@@ -14,7 +14,7 @@ Type=oneshot
RemainAfterExit=yes
ExecStartPre=/sbin/modprobe zfs
ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN
-ExecStartPost=/bin/bash -c "/usr/bin/systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs)"
+ExecStartPost=/bin/bash -c "/bin/systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs | /bin/awk '$1 != \"-\" {print; exit}')"
[Install]
WantedBy=zfs-import.target
diff --git a/etc/systemd/system/zfs-import-scan.service.in b/etc/systemd/system/zfs-import-scan.service.in
index 0a5951f4c..09eef175e 100644
--- a/etc/systemd/system/zfs-import-scan.service.in
+++ b/etc/systemd/system/zfs-import-scan.service.in
@@ -13,7 +13,7 @@ Type=oneshot
RemainAfterExit=yes
ExecStartPre=/sbin/modprobe zfs
ExecStart=@sbindir@/zpool import -aN -o cachefile=none
-ExecStartPost=/bin/bash -c "/usr/bin/systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs)"
+ExecStartPost=/bin/bash -c "/bin/systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs | /bin/awk '$1 != \"-\" {print; exit}')"
[Install]
WantedBy=zfs-import.target