aboutsummaryrefslogtreecommitdiff
path: root/libexec/rc
diff options
context:
space:
mode:
authorEugene Grosbein <eugen@FreeBSD.org>2018-10-27 17:21:13 +0000
committerEugene Grosbein <eugen@FreeBSD.org>2018-10-27 17:21:13 +0000
commitb25a469f94c39badfb17aba2cd33a388a4b12aaf (patch)
tree4a5edefe51ef10ab7bf53e401554399e33355f80 /libexec/rc
parent4a36780b2a5e9365aab9871013566488039ecccd (diff)
downloadsrc-b25a469f94c39badfb17aba2cd33a388a4b12aaf.tar.gz
src-b25a469f94c39badfb17aba2cd33a388a4b12aaf.zip
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. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D15247
Notes
Notes: svn path=/head/; revision=339818
Diffstat (limited to 'libexec/rc')
-rwxr-xr-xlibexec/rc/rc.resume18
1 files changed, 18 insertions, 0 deletions
diff --git a/libexec/rc/rc.resume b/libexec/rc/rc.resume
index cce616155acb..55fd6ffec145 100755
--- a/libexec/rc/rc.resume
+++ b/libexec/rc/rc.resume
@@ -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