From nobody Tue Sep 20 18:51:17 2022 X-Original-To: dev-commits-src-main@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 4MX9cT58MWz4d6S2; Tue, 20 Sep 2022 18:51:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MX9cS57ytz4400; Tue, 20 Sep 2022 18:51:20 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTP id actcomhzpS8WraiL2od7of; Tue, 20 Sep 2022 18:51:20 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id aiL0oAgZ4g786aiL1oVFnf; Tue, 20 Sep 2022 18:51:20 +0000 X-Authority-Analysis: v=2.4 cv=a94jSGeF c=1 sm=1 tr=0 ts=632a0ba8 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=xOM3xZuef0cA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=wJMnbLUvRtbBnFtE8jMA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 0B2FF1E5; Tue, 20 Sep 2022 11:51:18 -0700 (PDT) Received: from slippy (localhost [IPv6:::1]) by slippy.cwsent.com (Postfix) with ESMTP id EBC0FC6; Tue, 20 Sep 2022 11:51:17 -0700 (PDT) Date: Tue, 20 Sep 2022 11:51:17 -0700 From: Cy Schubert To: Bryan Drewery Cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 27b9777c28b4 - main - libexec/rc: Add var_run rc script Message-ID: <20220920115117.07a0850c@slippy> In-Reply-To: References: <202209051320.285DKBco081441@gitrepo.freebsd.org> Organization: KOMQUATS X-Mailer: Claws Mail 3.19.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfHrLcFrB0GrM8TTGFzWd3JAOIe+fnaEDOUKxrbOGn8I2HF8G4AolWtm+mDAp7t+Qv4tXn2sblKhPrTXH6eUeZy5DpKTkmZSNxQTfXl/L23Qhy+u7C9zR HBcjm2Fq7kc141F02UXFCOizjJV+gpa4dN8+nYDfpGREHasYcnQlXR+MtgrJ2uImOH6gBiDl0G6RfqX24lGTrd4xXbxzYKnzPnBp3u9btO/cIT9lIa70FBTm QEwUAGmx2uYUttHRO1DyY2SQtuHXtUobGBrwFWzAbBzxZKo2yoM5ZEK8gxBxLMRIs+WCb7yvOIAc3T0aVBzk6Kj8mCqYVIHZvNKExQ1IA5QYwayRrRAR9aFu T7SF+8tV X-Rspamd-Queue-Id: 4MX9cS57ytz4400 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 3.97.99.32) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-1.70 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.99)[-0.989]; NEURAL_HAM_MEDIUM(-0.91)[-0.910]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_IN_DNSWL_MED(-0.20)[3.97.99.32:from]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; R_SPF_NA(0.00)[no SPF record]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; HAS_ORG_HEADER(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; RCVD_COUNT_FIVE(0.00)[5]; ARC_NA(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; RCVD_TLS_LAST(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, 20 Sep 2022 10:44:05 -0700 Bryan Drewery wrote: > On 9/5/2022 6:20 AM, Cy Schubert wrote: > > The branch main has been updated by cy: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=27b9777c28b4e9474bdc500c28d04feec48fbb84 > > > > commit 27b9777c28b4e9474bdc500c28d04feec48fbb84 > > Author: Cy Schubert > > AuthorDate: 2022-08-28 12:48:25 +0000 > > Commit: Cy Schubert > > CommitDate: 2022-09-05 13:19:42 +0000 > > > > libexec/rc: Add var_run rc script > > > > Users with a tmpfs /var/run will lose the directory tree state of > > /var/run at reboot. This rc script will optionally (by default) > > capture the state of the directory structure in /var/run prior to > > shutdown and recreate it at system boot. > > > > Alternatively a user can save the state of the /var/run directories > > manually using service var_run save and disable the autosaving of > > /var/run state using the var_run_autosave variable, for those > > paranoid SSD users. > > > > PR: 259585, 259699 > > Reported by: freebsd@walstatt-de.de, > > Reviewed by: philip, gbe (previous version) > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D36386 > > --- > > etc/mtree/BSD.var.dist | 2 ++ > > libexec/rc/rc.conf | 6 ++++++ > > libexec/rc/rc.d/Makefile | 1 + > > libexec/rc/rc.d/var_run | 47 +++++++++++++++++++++++++++++++++++++++++++++++ > > share/man/man5/rc.conf.5 | 28 ++++++++++++++++++++++++++++ > > 5 files changed, 84 insertions(+) > > > > diff --git a/etc/mtree/BSD.var.dist b/etc/mtree/BSD.var.dist > > index 0f73ba1824ae..24961accf7fb 100644 > > --- a/etc/mtree/BSD.var.dist > > +++ b/etc/mtree/BSD.var.dist > > @@ -46,6 +46,8 @@ > > .. > > ipf mode=0700 tags=package=ipf > > .. > > + mtree > > + .. > > ntp uname=ntpd gname=ntpd > > .. > > pkg > > diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf > > index 6b2c33792ea7..bc908075d033 100644 > > --- a/libexec/rc/rc.conf > > +++ b/libexec/rc/rc.conf > > @@ -61,6 +61,12 @@ varmfs_flags="-S" # Extra mount options for the mfs /var > > mfs_type="auto" # "md", "tmpfs", "auto" to prefer tmpfs with md as fallback > > populate_var="AUTO" # Set to YES to always (re)populate /var, NO to never > > cleanvar_enable="YES" # Clean the /var directory > > +var_run_enable="NO" # Save/restore /var/run structure at shutdown/reboot > > +var_run_autosave="NO" # Only restore /var/run structure at shutdown/reboot > > + # The user is expected to issue service var_run save to > > + # manually save the /var/run mtree > > +var_run_mtree="/var/db/mtree/BSD.var-run.mtree" > > + # Where to save /var/run mtree > > local_startup="${_localbase}/etc/rc.d" # startup script dirs. > > script_name_sep=" " # Change if your startup scripts' names contain spaces > > rc_conf_files="/etc/rc.conf /etc/rc.conf.local" > > diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile > > index 3eabd17df993..e8ee61ffdff8 100644 > > --- a/libexec/rc/rc.d/Makefile > > +++ b/libexec/rc/rc.d/Makefile > > @@ -111,6 +111,7 @@ CONFS= DAEMON \ > > ugidfw \ > > ${_utx} \ > > var \ > > + var_run \ > > watchdogd > > > > .if ${MK_NIS} != "no" > > diff --git a/libexec/rc/rc.d/var_run b/libexec/rc/rc.d/var_run > > new file mode 100755 > > index 000000000000..8da3f40a0e7c > > --- /dev/null > > +++ b/libexec/rc/rc.d/var_run > > @@ -0,0 +1,47 @@ > > +#!/bin/sh > > + > > +# PROVIDE: var_run > > +# REQUIRE: mountcritlocal > > +# BEFORE: cleanvar > > Don't we need the shutdown keyword too? > > # KEYWORD: shutdown Thanks. Fixed in b77b3099685f. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0