remove pools without a bootfs from BOOTFS variable
Use the same method used in zfs-load-key. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Llewelyn Trahaearn <WoefulDerelict@GMail.com> Signed-off-by: Matthew Thode <mthode@mthode.org> Closes #7089
This commit is contained in:
parent
bee7e4ff12
commit
1d8a71b603
|
@ -14,7 +14,7 @@ Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
ExecStartPre=/sbin/modprobe zfs
|
ExecStartPre=/sbin/modprobe zfs
|
||||||
ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN
|
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]
|
[Install]
|
||||||
WantedBy=zfs-import.target
|
WantedBy=zfs-import.target
|
||||||
|
|
|
@ -13,7 +13,7 @@ Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
ExecStartPre=/sbin/modprobe zfs
|
ExecStartPre=/sbin/modprobe zfs
|
||||||
ExecStart=@sbindir@/zpool import -aN -o cachefile=none
|
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]
|
[Install]
|
||||||
WantedBy=zfs-import.target
|
WantedBy=zfs-import.target
|
||||||
|
|
Loading…
Reference in New Issue