I transitioned from systemd/btrfs to openrc/zfs recently and for a week I've been trying to debug why no pools, except for rpool, were being imported at boot. I eventually noticed that the zfs-import service was finishing without error but not otherwise doing anything. It turns out that the service files' shebangs were '#!/bin/sh'. The service files defined depend(), start(), and status(), but were not being run. The problem appears to be here: https://github.com/openzfs/zfs/blob/90b77a0364a44ec568aa984558dea9901867653d/config/zfs-build.m4#L570. If /sbin/openrc-run exists (i.e., sys-apps/openrc is currently installed) the shebang is '#!/sbin/openrc-run', otherwise it's '#!/bin/sh'. This implies an automagic build-time dependency on sys-apps/openrc instead of unconditionally installing the init files with '#!/sbin/openrc-run' (afaik, the correct behavior).
some prior manifestation of this hardcoded assumption: https://github.com/openzfs/zfs/issues/8204 your PR seems to be ok though.
PR accepted upstream with commit https://github.com/openzfs/zfs/commit/6ef28c526ba7199a3740407d764b6505618ca8ba. If not backporting, feel free to close.
since linux 5.15 is out there will be zfs release soon. I'll keep an eye on it, if it does not get it - I'll include and maybe include in older versions as well.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52257c6d64aa3817575311016151e29ca46be0b9 commit 52257c6d64aa3817575311016151e29ca46be0b9 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2021-12-16 02:29:05 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2021-12-16 02:51:03 +0000 sys-fs/zfs: add 2.1.2 Bug: https://bugs.gentoo.org/815817 Closes: https://bugs.gentoo.org/820278 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> sys-fs/zfs/Manifest | 2 + sys-fs/zfs/files/2.1.2-openrc-vendor.patch | 42 ++++ sys-fs/zfs/files/2.1.2-scrub-timers.patch | 147 ++++++++++++++ sys-fs/zfs/zfs-2.1.2.ebuild | 303 +++++++++++++++++++++++++++++ 4 files changed, 494 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75a131e7d043e3e3ff0e15aa2038ebdf47997dc3 commit 75a131e7d043e3e3ff0e15aa2038ebdf47997dc3 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2021-12-26 22:30:57 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2021-12-26 22:35:03 +0000 sys-fs/zfs: drop 2.0.6-r1 Bug: https://bugs.gentoo.org/820278 Closes: https://bugs.gentoo.org/815817 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> sys-fs/zfs/Manifest | 2 - sys-fs/zfs/files/2.0.4-scrub-timers.patch | 97 ---------- sys-fs/zfs/zfs-2.0.6-r1.ebuild | 302 ------------------------------ 3 files changed, 401 deletions(-)