From nobody Tue May 23 15:22:31 2023 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 4QQdNX1F3zz4CbRk; Tue, 23 May 2023 15:22:36 +0000 (UTC) (envelope-from christos@freebsd.org) Received: from margiolis.net (mail.margiolis.net [95.179.159.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQdNW0qD8z4GlN; Tue, 23 May 2023 15:22:35 +0000 (UTC) (envelope-from christos@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=margiolis.net header.s=default header.b=Ce0BI+8H; spf=softfail (mx1.freebsd.org: 95.179.159.8 is neither permitted nor denied by domain of christos@freebsd.org) smtp.mailfrom=christos@freebsd.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=default; bh=VOoWT+OeZaws vXU7hKYFyKg/5zRU6mUPJkfdbb0zZgo=; h=in-reply-to:references:subject:to: from:date; d=margiolis.net; b=Ce0BI+8HYPOr6ymxoaEfNPFt03AetHHRUN/sFWSa n7fOP9sc9FMybgUE00/47fUzbkvGPInPCIEbPkJelm3uVXxBP7lXADUGmtWuf8yDrNDvHV qI4Lp47Bt643lpbcvcW4+zRcABC0QSXh7aOESo+KSrBLPYWepSN/PeS0rnppI= Received: from pleb (ppp-94-66-59-70.home.otenet.gr [94.66.59.70]) by margiolis.net (OpenSMTPD) with ESMTPSA id e23cb9b1 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 23 May 2023 15:22:32 +0000 (UTC) Date: Tue, 23 May 2023 18:22:31 +0300 From: Christos Margiolis To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 2cf8ef5910fd - main - rc.suspend: execute rc-scripts with suspend keyword Message-ID: <20230523152231.mdlnl6raoc3p7cmh@pleb> References: <202305231513.34NFDUKl098736@gitrepo.freebsd.org> 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-Disposition: inline In-Reply-To: <202305231513.34NFDUKl098736@gitrepo.freebsd.org> X-Spamd-Result: default: False [-2.80 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_ALLOW(-0.20)[margiolis.net:s=default]; 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)[]; MIME_TRACE(0.00)[0:+]; DKIM_TRACE(0.00)[margiolis.net:+]; ASN(0.00)[asn:20473, ipnet:95.179.144.0/20, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[christos]; ARC_NA(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4QQdNW0qD8z4GlN X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N The comment deletion is unrelated to the patch (should be its own patch) and was a result of misunderstanding in the PR. Christos Margiolis wrote: > The branch main has been updated by christos: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2cf8ef5910fd3754f8021f9c67fde6b9d9030f33 > > commit 2cf8ef5910fd3754f8021f9c67fde6b9d9030f33 > Author: Johannes Totz > AuthorDate: 2023-05-23 15:11:31 +0000 > Commit: Christos Margiolis > CommitDate: 2023-05-23 15:11:31 +0000 > > rc.suspend: execute rc-scripts with suspend keyword > > For symmetry with rc.resume, give rc.suspend the ability to execute > rc-scripts. Use the suspend keyword for that. > > Use-case is for setting a wake-up time, e.g. via efiwake. > > Reviewed by: christos > Approved by: markj (mentor) > Differential Revision: https://reviews.freebsd.org/D39965 > --- > libexec/rc/rc.suspend | 23 ++++++++++++++++++----- > 1 file changed, 18 insertions(+), 5 deletions(-) > > diff --git a/libexec/rc/rc.suspend b/libexec/rc/rc.suspend > index 5f22cd1a05b1..41b5bcbf897b 100755 > --- a/libexec/rc/rc.suspend > +++ b/libexec/rc/rc.suspend > @@ -43,15 +43,28 @@ fi > > echo $$ 2> /dev/null > /var/run/rc.suspend.pid > > -# If you have troubles on suspending with PC-CARD modem, try this. > -# See also contrib/pccardq.c (Only for PAO users). > -# pccardq | awk -F '~' '$5 == "filled" && $4 ~ /uart/ \ > -# { printf("pccardc power %d 0", $1); }' | sh > - > # If a device driver has problems suspending, try unloading it before > # suspend and reloading it on resume. Example: > # kldunload usb > > +. /etc/rc.subr > + > +load_rc_config > + > +rcorder_opts="-k suspend" > + > +case ${local_startup} in > +[Nn][Oo] | '') ;; > +*) find_local_scripts_new ;; > +esac > + > +files=`rcorder ${rcorder_opts} /etc/rc.d/* ${local_rc} 2>/dev/null` > + > +for _rc_elem in $files; do > + debug "run_rc_script $_rc_elem suspend" > + run_rc_script $_rc_elem suspend > +done > + > /usr/bin/logger -t $subsystem suspend at `/bin/date +'%Y%m%d %H:%M:%S'` > /bin/sync && /bin/sync && /bin/sync > /bin/sleep 3