When using zfs on "external" block devices, fot example iscsi of FC - one common zfs init-script can not handle all situations. Because it have depend: "before net bootmisc" as needed for local filesystems. But I may need net to be started for zfs pools to be accessible. I think at least this should be modifed to make this possible. 1) depend section should contain conditionals. If it is a symlinked script, then it should not use before. 2) ZPOOL_CACHE="/etc/zfs/zpool.cache" should be changed to form: ZPOOL_CACHE="${ZPOOL_CACHE:-/etc/zfs/zpool.cache}" 3) Stop section should do something different from zfs umount -a. May be it should use specified parameter or somehow calculete what it needs to umount. 4) ... ? Then it will be possible to make symlink: /etc/init.d/zfs -> zfs.local and make /etc/conf.d/zfs.local whith needed parameters: ZPOOL_CACHE=/etc/zfs/zpool-local.cache RC_AFTER=multipathd ...
I inherited maintenance of that script, but I am certain that it could be improved. Anyway, I will try to look into this when I find time. I am extremely busy right now. Patches to expedite that process are always welcome.
A brief update. I have taken over maintenance of sys-block/iscsitarget, so I am paying more attention to iSCSI now. I am still not quite ready to work on this, but I am getting there. :)
Having given this some thought and having looked at improving the zfs OpenRC script today, I do not see a sane way of modifying the zfs OpenRC script to support this. It would need to be another OpenRC script, possibly called zfs-netmount. With that said, diskless systems mount things through a different process that occurs before /sbin/init even runs, which occurs in either the kernel or an initramfs. If you place a ZFS rootfs on an iSCSI target, then it should be mounted long before this script runs. The only time when it would be helpful would be if you have a non-ZFS pool on remote storage. If you have remote storage, you have a SAN, which can be arbitrarily large, so I am having trouble seeing why you would want additional remote pools in the first place. I also see no reason why a custom script could not be placed into /etc/local.d. As much as I like to say yes to people, I do not see a reason to go out of my way to enable this kind of a configuration. You have the ability to support it locally without much effort, so there is no need for me to do anything here. I am going to close this as WONTFIX.