From owner-svn-src-stable@freebsd.org Mon Nov 26 13:23:13 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0637011355A0; Mon, 26 Nov 2018 13:23:13 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B076D73487; Mon, 26 Nov 2018 13:23:11 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 775F5485E; Mon, 26 Nov 2018 13:23:11 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQDNBhc088526; Mon, 26 Nov 2018 13:23:11 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQDNAvW088523; Mon, 26 Nov 2018 13:23:10 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811261323.wAQDNAvW088523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 26 Nov 2018 13:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340965 - in stable/12: libexec/rc sbin/rcorder share/man/man8 usr.sbin/acpi/acpiconf X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in stable/12: libexec/rc sbin/rcorder share/man/man8 usr.sbin/acpi/acpiconf X-SVN-Commit-Revision: 340965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B076D73487 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.22)[0.215,0]; NEURAL_SPAM_MEDIUM(0.61)[0.608,0]; NEURAL_SPAM_LONG(0.63)[0.630,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 13:23:13 -0000 Author: eugen Date: Mon Nov 26 13:23:10 2018 New Revision: 340965 URL: https://svnweb.freebsd.org/changeset/base/340965 Log: MFC r339818: rcorder(8) Add support for /etc/rc.resume, so it calls "rcorder -k resume" and runs scripts containing "KEYWORD: resume" with single "resume" argument. Working example is the port sysutils/cpupdate that defines extra_commands="resume" to reload CPU microcode cleared by suspend/resume sequence. This change does nothing for a system having no scripts with KEYWORD: resume. PR: 227866 Differential Revision: https://reviews.freebsd.org/D15247 Modified: stable/12/libexec/rc/rc.resume stable/12/sbin/rcorder/rcorder.8 stable/12/share/man/man8/rc.8 stable/12/usr.sbin/acpi/acpiconf/acpiconf.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.resume ============================================================================== --- stable/12/libexec/rc/rc.resume Mon Nov 26 13:08:34 2018 (r340964) +++ stable/12/libexec/rc/rc.resume Mon Nov 26 13:23:10 2018 (r340965) @@ -55,4 +55,22 @@ fi /usr/bin/logger -t $subsystem resumed at `/bin/date +'%Y%m%d %H:%M:%S'` /bin/sync && /bin/sync && /bin/sync +. /etc/rc.subr + +load_rc_config + +rcorder_opts="-k resume" + +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 resume" + run_rc_script $_rc_elem resume +done + exit 0 Modified: stable/12/sbin/rcorder/rcorder.8 ============================================================================== --- stable/12/sbin/rcorder/rcorder.8 Mon Nov 26 13:08:34 2018 (r340964) +++ stable/12/sbin/rcorder/rcorder.8 Mon Nov 26 13:23:10 2018 (r340965) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2016 +.Dd October 27, 2018 .Dt RCORDER 8 .Os .Sh NAME @@ -136,6 +136,23 @@ There must be at least one file with no dependencies i arguments passed to .Nm in order for it to find a starting place in the dependency ordering. +.Sh KEYWORDS +There are several +.Em KEYWORDs +in use: +.Bl -tag -width ".Cm shutdown" -offset indent +.It Cm firstboot, nojail, nojailvnet, nostart +Used by +.Xr rc 8 . +.It Cm resume +Used by +.Nm /etc/rc.resume +(see +.Xr acpiconf 8 ) +.It Cm shutdown +Used by +.Xr rc.shutdown 8 . +.El .Sh DIAGNOSTICS The .Nm @@ -156,7 +173,9 @@ A set of files has a circular dependency which was det processing the stated file. .El .Sh SEE ALSO -.Xr rc 8 +.Xr acpiconf 8 , +.Xr rc 8 , +.Xr rc.shutdown 8 .Sh HISTORY The .Nm Modified: stable/12/share/man/man8/rc.8 ============================================================================== --- stable/12/share/man/man8/rc.8 Mon Nov 26 13:08:34 2018 (r340964) +++ stable/12/share/man/man8/rc.8 Mon Nov 26 13:23:10 2018 (r340965) @@ -44,6 +44,7 @@ .Nm rc.d/ .Nm rc.firewall .Nm rc.local +.Nm rc.resume .Nm rc.shutdown .Nm rc.subr .Sh DESCRIPTION @@ -563,6 +564,7 @@ is unnecessary, but is often included. .Xr kill 1 , .Xr rc.conf 5 , .Xr init 8 , +.Xr rc.resume 8 , .Xr rc.subr 8 , .Xr rcorder 8 , .Xr reboot 8 , Modified: stable/12/usr.sbin/acpi/acpiconf/acpiconf.8 ============================================================================== --- stable/12/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Nov 26 13:08:34 2018 (r340964) +++ stable/12/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Nov 26 13:23:10 2018 (r340965) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 22, 2015 +.Dd October 27, 2018 .Dt ACPICONF 8 .Os .Sh NAME @@ -72,13 +72,35 @@ If the .Pa /etc/rc.suspend and .Pa /etc/rc.resume -scripts are executable, they will be run before and after entering -the given sleep state. +scripts are executable, they will be run by +.Xr devd 8 +or +.Xr apmd 8 +before and after entering the given sleep state. +.Pp +The +.Pa /etc/rc.resume +script uses the +.Xr rcorder 8 +utility to call scripts in +.Pa /etc/rc.d/ +and the +.Va $local_startup +directories that have a "resume" KEYWORD. +Called scripts are supplied with single "resume" +command line argument. See +.Xr rc.conf 5 +for more information about +.Va $local_startup . .El .Sh SEE ALSO .Xr acpi 4 , .Xr acpidump 8 , -.Xr apm 8 +.Xr apm 8 , +.Xr apmd 8 , +.Xr devd 8 , +.Xr rc.conf 5 , +.Xr rcorder 8 .Sh HISTORY The .Nm