Skip to content

Commit

Permalink
remove pools without a bootfs from BOOTFS variable
Browse files Browse the repository at this point in the history
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 openzfs#7089
  • Loading branch information
prometheanfire authored and behlendorf committed Jan 30, 2018
1 parent bee7e4f commit 1d8a71b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion etc/systemd/system/zfs-import-cache.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion etc/systemd/system/zfs-import-scan.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1d8a71b

Please sign in to comment.