From ee9dbf0a371c4366441e7b08ae51e3e092635123 Mon Sep 17 00:00:00 2001 From: Ryan Stone Date: Thu, 22 May 2014 22:00:26 -0400 Subject: [PATCH 19/21] Add an rc.d script to invoke iovctl(8) during boot --- etc/defaults/rc.conf | 2 ++ etc/rc.d/Makefile | 1 + etc/rc.d/iovctl | 39 +++++++++++++++++++++++++++++++++++++++ etc/rc.d/netif | 2 +- share/man/man5/rc.conf.5 | 7 +++++++ 5 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 etc/rc.d/iovctl diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index aa19b30..f4360ac 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -660,6 +660,8 @@ casperd_enable="YES" # casperd(8) daemon rctl_enable="NO" # Load rctl(8) rules on boot rctl_rules="/etc/rctl.conf" # rctl(8) ruleset. See rctl.conf(5). +iovctl_files="" # Config files for iovctl(8) + ############################################################## ### Jail Configuration (see rc.conf(5) manual page) ########## ############################################################## diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile index 7302d29..0d95ddf 100644 --- a/etc/rc.d/Makefile +++ b/etc/rc.d/Makefile @@ -56,6 +56,7 @@ FILES= DAEMON \ hostname \ inetd \ initrandom \ + iovctl \ ip6addrctl \ ipfilter \ ipfs \ diff --git a/etc/rc.d/iovctl b/etc/rc.d/iovctl new file mode 100644 index 0000000..f207b08 --- /dev/null +++ b/etc/rc.d/iovctl @@ -0,0 +1,39 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: iovctl +# REQUIRE: FILESYSTEMS sysctl + +. /etc/rc.subr + +name="iovctl" +command="/usr/sbin/iovctl" +start_cmd="iovctl_start" +stop_cmd="iovctl_stop" + +run_iovctl() +{ + local _f flag + + flag=$1 + for _f in ${iovctl_files} ; do + if [ -r ${_f} ]; then + ${command} ${flag} -f ${_f} > /dev/null + fi + done +} + +iovctl_start() +{ + run_iovctl -E +} + +iovctl_stop() +{ + run_iovctl -D +} + +load_rc_config $name +run_rc_command "$1" diff --git a/etc/rc.d/netif b/etc/rc.d/netif index 154f1ce..88f08bd 100755 --- a/etc/rc.d/netif +++ b/etc/rc.d/netif @@ -26,7 +26,7 @@ # # PROVIDE: netif -# REQUIRE: atm1 FILESYSTEMS serial sppp sysctl +# REQUIRE: atm1 FILESYSTEMS iovctl serial sppp sysctl # REQUIRE: ipfilter ipfs # KEYWORD: nojailvnet diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 2dd713b..2684fcf 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -4428,6 +4428,12 @@ This variables contains the .Xr rctl.conf 5 ruleset to load for .Xr rctl 8 . +.It Va iovctl_files +.Pq Vt str +A space-separated list of configuration files used by the +.Xr iovctl 8 +utility. +The default value is "". .El .Sh FILES .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact @@ -4481,6 +4487,7 @@ ruleset to load for .Xr hcsecd 8 , .Xr ifconfig 8 , .Xr inetd 8 , +.Xr iovctl 8 , .Xr ipf 8 , .Xr ipfw 8 , .Xr ipnat 8 , -- 1.9.2