Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Dec 2020 20:52:45 +0000
From:      cglogic <cglogic@protonmail.com>
To:        Mateusz Piotrowski <0mp@FreeBSD.org>
Cc:        "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-stable@freebsd.org" <svn-src-stable@freebsd.org>, "svn-src-stable-12@freebsd.org" <svn-src-stable-12@freebsd.org>
Subject:   Re: svn commit: r367546 - stable/12/libexec/rc/rc.d
Message-ID:  <LNcke0Qe4kmorsioFV5tyvevTn31UNEF1ZpQ3BlEsLuWTSgEUCzTs5vGBA_T953duoYY2Z3k9COMPYX89Sgmdr4gQiUJn1h0bbenOfh25Xw=@protonmail.com>
In-Reply-To: <202011100747.0AA7lOEh032507@repo.freebsd.org>
References:  <202011100747.0AA7lOEh032507@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, November 10, 2020 9:47 AM, Mateusz Piotrowski <0mp@FreeBSD.org>=
 wrote:

> Author: 0mp (doc,ports committer)
> Date: Tue Nov 10 07:47:24 2020
> New Revision: 367546
> URL: https://svnweb.freebsd.org/changeset/base/367546
>
> Log:
> MFC r367291:
>
> rc.d/zfs: Add shutdown to KEYWORDS
>
> The problem is that without walling /etc/rc.d/zfs on shutdown, resources
> associated with ZFS mounts are not freed and the jails will remain in dyi=
ng
> state. In addition, the dataset is now in a dangling state, as the jail i=
t
> is attached to is dying.
>
> A known workaround for jails was to add the following lines
> to /etc/jail.conf, to make sure that "service zfs stop" is run
> when the jail is stopped:
>
> exec.stop =3D "/bin/sh /etc/rc.shutdown";
> exec.stop +=3D "/usr/sbin/service zfs stop || /usr/bin/true";
>
> While the workaround seems to be okay-ish for the jail situation, it is
> still unclean. However, for physical hosts this may wreak havoc with the
> pool if shared spares are used, as "zfs unshare" is never invoked on
> shutdown.
>
> PR: 147444
> Submitted by: Markus Stoff <markus__stoffdv_at>
> Reported by: Mykah <mburkhardt__exavault_com>
>
> Reviewed by: cy
> Approved by: cy (src)
> Relnotes: yes
>
> Modified:
> stable/12/libexec/rc/rc.d/zfs
> Directory Properties:
> stable/12/ (props changed)
>
> Modified: stable/12/libexec/rc/rc.d/zfs
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> --- stable/12/libexec/rc/rc.d/zfs Tue Nov 10 02:26:44 2020 (r367545)
> +++ stable/12/libexec/rc/rc.d/zfs Tue Nov 10 07:47:24 2020 (r367546)
> @@ -6,6 +6,7 @@
>
> PROVIDE: zfs
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> REQUIRE: zfsbe
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> BEFORE: FILESYSTEMS var
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> +# KEYWORD: shutdown
>
> . /etc/rc.subr

This caused
  Dec  2 22:47:16 hostname kernel: cannot unmount '/var/run': Device busy
  Dec  2 22:47:16 hostname kernel: cannot unmount '/var/log': Device busy
  Dec  2 22:47:16 hostname kernel: cannot unmount '/var/db': Device busy
  Dec  2 22:47:16 hostname kernel: cannot unmount '/var': Device busy
  Dec  2 22:47:16 hostname kernel: cannot unmount '/usr': Device busy
  Dec  2 22:47:16 hostname kernel: cannot unmount '/home/user': Device busy
  Dec  2 22:47:16 hostname kernel: cannot unmount '/home': Device busy
  Dec  2 22:47:16 hostname kernel: cannot unmount '/': Invalid argument
on every shutdown.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?LNcke0Qe4kmorsioFV5tyvevTn31UNEF1ZpQ3BlEsLuWTSgEUCzTs5vGBA_T953duoYY2Z3k9COMPYX89Sgmdr4gQiUJn1h0bbenOfh25Xw=>