From nobody Fri Feb 10 22:08:38 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PD7D83wvrz3n2LM for ; Fri, 10 Feb 2023 22:08:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PD7D82vlGz43hZ for ; Fri, 10 Feb 2023 22:08:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676066920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OQhCb9s6rB2WcGw2PFQY0C/J9/1BuQK7a+tRb2CgqDI=; b=KfYuF2BbGNwBlzvrtH2LIQwXYCMKARugJCzmDgFxGZ3O0REH0jena5Q72MGbCOuZEHcjw8 SyajQT1b2ZQpRpBsH5d5IHurmo22ulC9HZSPGknm8YIpKoyIjQYiz+kbl8ngRqfQfFA4zV 74CvJvJimQFsz3ktUU7tjmCzk2V100214VQstY65fzgjo3p25eiC0ioSFvAzygi9Y2lWrG d/p7z99z283lMXlvoikPmtw8OgcJD+4GdGWq3DQm0gZYUoPGOOOUaEURlWb3yAv1LS0RKj N2Y8ygaQIL0w0qMUif2S4DiplOrgfzye+DHvb3EgHtOmDt5JSgrhM5IE5GBayw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676066920; a=rsa-sha256; cv=none; b=L8u6bpvzUhH+7XBO9Ae1Ya8XQsGc1tK1JYbF/LVfTJj+bTadbLf+2XnFqrHA20CuLACcmD YGbOcIKQcuTxr4pNHEXX60z5OmwE5K+A+iHVHUGwdjBX+DJTQkvN1hwvp0+G0LR8qVy5YA ftBXB15r6n6f7hEfAqi9pRR9wUQWneha6sWhwhjaXbtanUewy2eUU/4A2C1wGNkPGmGfHH P+wcJkEaEsqC5DDIiHCyKod2rDl4/xGWvGw6tqjoSX7l2r4Yp4wqydvqHvab2WH91tZYYY dZuY3YrW6blEg8pjK2roFlaPRmg0AeBt6jh71dZ2nBBlCDeBqrGo71cI6Ud09g== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PD7D8201qzZn7 for ; Fri, 10 Feb 2023 22:08:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 31AM8eLY022211 for ; Fri, 10 Feb 2023 22:08:40 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 31AM8eQ1022210 for bugs@FreeBSD.org; Fri, 10 Feb 2023 22:08:40 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 260160] zfs jailed: snapshots not accessible Date: Fri, 10 Feb 2023 22:08:38 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: freebsd-bugzilla@umpquanet.com X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260160 --- Comment #25 from Jim Long --- For those affected by this regression who are looking for a workaround that eliminates (or rather, automates) the need to run 'jail -m ...' on each jail that requires access to its snapshots: This simple change to the globals section of /etc/jail.conf uses the "exec.poststart" hook to have /etc/rc.d/jail spawn a small subshell process after each jail is started (either at boot time or by "service jail [re]start"). >From man 8 jail: exec.poststart Command(s) to run in the system environment after a jail is created, and after any exec.start commands have completed. This is very much a temporary hack until a proper fix is merged into the codebase, but the method appears to be both effective and minimally intrusi= ve: /etc/jail.conf: # Global: # .. whatever global stuff you already have zfs.mount_snapshot =3D 1; exec.poststart =3D "( /bin/sleep 30; /usr/sbin/jail -m $name ) &"; # ... and whatever else you like ... jail1 { # ... your normal per-jail parameters here } jail2 { # ... your normal per-jail parameters here } If you prefer not to do this globally, the "poststart" directive can be del= eted from the global context and inserted into each individual jail where it is needed. For my purposes the global context is more convenient, because my primary u= se case is several jailed Samba instances where I want to allow end-user acces= s to ZFS snapshots of the data share, so that users can access backups without a= ny sysadmin intervention. A secondary use case is to simply allow root-users = of jailed FreeBSD instances to access snapshot backups of their own system fil= es. In both cases, however, it is also desired that the root user of the jail N= OT be able to destroy snapshots. Hence the reason for not simply setting "jailed=3Don" and delegating the entire ZFS filesystem to the jail. Effect= ively this makes the backups readable by the jail, but immutable by even the jail root. HTH, Jim --=20 You are receiving this mail because: You are the assignee for the bug.=