From 1aa40d8e496c4923846e3295dd105899dca6537f Mon Sep 17 00:00:00 2001 From: bdrewery Date: Sun, 23 Feb 2014 20:04:29 +0000 Subject: MFC r261931,r261932: Allow overriding rctl.conf(5) file location for /etc/rc.d/rctl Approved by: bapt (mentor, implicit) --- etc/defaults/rc.conf | 4 ++++ etc/rc.d/rctl | 4 ++-- share/man/man5/rc.conf.5 | 22 +++++++++++++++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index 1ee6324..5e6b740 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -663,6 +663,10 @@ newsyslog_flags="-CN" # Newsyslog flags to create marked files mixer_enable="YES" # Run the sound mixer. opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off +# rctl(8) requires kernel options RACCT and RCTL +rctl_enable="NO" # Load rctl(8) rules on boot +rctl_rules="/etc/rctl.conf" # rctl(8) ruleset. See rctl.conf(5). + ############################################################## ### Jail Configuration (see rc.conf(5) manual page) ########## ############################################################## diff --git a/etc/rc.d/rctl b/etc/rc.d/rctl index 4fa0579..567436b 100755 --- a/etc/rc.d/rctl +++ b/etc/rc.d/rctl @@ -15,7 +15,7 @@ stop_cmd="rctl_stop" rctl_start() { - if [ -f /etc/rctl.conf ]; then + if [ -f ${rctl_rules} ]; then while read var comments do case ${var} in @@ -25,7 +25,7 @@ rctl_start() rctl -a "${var}" ;; esac - done < /etc/rctl.conf + done < ${rctl_rules} fi } diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index e89e729..50cf901 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 25, 2013 +.Dd February 15, 2014 .Dt RC.CONF 5 .Os .Sh NAME @@ -4416,6 +4416,26 @@ interface if desired. Defines the total number of seconds to wait for link to become usable, polled at a 1-second interval. The default is 30. +.It Va rctl_enable +.Pq Vt bool +Set to +.Dq Li YES +to load +.Xr rctl 8 +rules from the defined ruleset. +The kernel must be built with +.Cd "options RACCT" +and +.Cd "options RCTL" . +.It Va rctl_rules +.Pq Vt str +Set to +.Pa /etc/rctl.conf +by default. +This variables contains the +.Xr rctl.conf 5 +ruleset to load for +.Xr rctl 8 . .El .Sh FILES .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact -- cgit v1.1