In message <240137891.21754.1749997280448@localhost>, Ronald Klop writes: > ------=_Part_21753_1823422774.1749997280446 > Content-Type: text/plain; charset=us-ascii; format=flowed > Content-Transfer-Encoding: 7bit > > Van: Cy Schubert <c...@freebsd.org> > Datum: 15 juni 2025 07:08 > Aan: src-committ...@freebsd.org, dev-commits-src-...@freebsd.org, dev-commits > -src-m...@freebsd.org > Onderwerp: git: b6e33f0cd536 - main - rc.d/mountcritlocal: Make sure zpools > are imported for legacy ZFS > > > > > > > The branch main has been updated by cy: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=b6e33f0cd53683e06570606d5bd88f > c04a4b76fe > > > > commit b6e33f0cd53683e06570606d5bd88fc04a4b76fe > > Author: Cy Schubert > > AuthorDate: 2025-06-14 13:16:16 +0000 > > Commit: Cy Schubert > > CommitDate: 2025-06-15 04:39:36 +0000 > > > > rc.d/mountcritlocal: Make sure zpools are imported for legacy ZFS > > > > Legacy ZFS uses fstab to mount its datasets. In an attempt to fix > > another problem 900bc0206348 broke legacy ZFS in fstab(5). This > > comit works around the problem by mountcritlocal scanning /etc/fstab > > for zfs mountpoint and if any are found invoke /etc/rc.d/zpool start. > > > > Reviewed by: imp > > Differential Revision: https://reviews.freebsd.org/D50844 > > --- > > libexec/rc/rc.d/mountcritlocal | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > diff --git a/libexec/rc/rc.d/mountcritlocal b/libexec/rc/rc.d/mountcritloca > l > > index f91eaf44457c..6dce672657fc 100755 > > --- a/libexec/rc/rc.d/mountcritlocal > > +++ b/libexec/rc/rc.d/mountcritlocal > > @@ -27,6 +27,15 @@ mountcritlocal_start() > > ;; > > esac > > > > + while read a b vfstype rest; do > > + if [ "$vfstype" = "zfs" -a "$a" != "#" ]; then > > + # zpool is needed for legacy ZFS > > + echo 'Importing zpools for legacy ZFS' > > + /etc/rc.d/zpool start > > + break > > + fi > > + done < /etc/fstab > > + > > # Mount everything except nfs filesystems. > > startmsg -n 'Mounting local filesystems:' > > mount_excludes='no' > > > > > > > > > > > > > Does this mean that a comment # must always be folllowed by a whitespace?
Yes. It's a hack but it's the only way without grep (when /usr may not be mounted). In the very worst case rc.d/zpool will be needlessly executed. -- Cheers, Cy Schubert <cy.schub...@cschubert.com> FreeBSD UNIX: <c...@freebsd.org> Web: https://FreeBSD.org NTP: <c...@nwtime.org> Web: https://nwtime.org e**(i*pi)+1=0