Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Mar 2011 18:32:45 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r220167 - head/etc/rc.d
Message-ID:  <201103301832.p2UIWjH0071775@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Wed Mar 30 18:32:45 2011
New Revision: 220167
URL: http://svn.freebsd.org/changeset/base/220167

Log:
  Add startup script, to load rules from /etc/rctl.conf.
  
  Sponsored by:	The FreeBSD Foundation
  Reviewed by:	kib (ealier version)

Added:
  head/etc/rc.d/rctl   (contents, props changed)
Modified:
  head/etc/rc.d/Makefile

Modified: head/etc/rc.d/Makefile
==============================================================================
--- head/etc/rc.d/Makefile	Wed Mar 30 18:27:52 2011	(r220166)
+++ head/etc/rc.d/Makefile	Wed Mar 30 18:32:45 2011	(r220167)
@@ -29,7 +29,7 @@ FILES=	DAEMON FILESYSTEMS LOGIN NETWORKI
 	pf pflog pfsync \
 	powerd power_profile ppp pppoed pwcheck \
 	quota \
-	random rarpd resolv rfcomm_pppd_server root \
+	random rarpd rctl resolv rfcomm_pppd_server root \
 	route6d routed routing rpcbind rtadvd rtsold rwho \
 	savecore sdpd securelevel sendmail \
 	serial sppp statd static_arp stf swap1 \

Added: head/etc/rc.d/rctl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/etc/rc.d/rctl	Wed Mar 30 18:32:45 2011	(r220167)
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: rctl
+# BEFORE: LOGIN
+# KEYWORD: nojail
+
+. /etc/rc.subr
+
+name="rctl"
+start_cmd="rctl_start"
+stop_cmd="rctl_stop"
+
+rctl_start()
+{
+	if [ -f /etc/rctl.conf ]; then
+		while read var comments
+		do
+			case ${var} in
+			\#*|'')
+				;;
+			*)
+				rctl -a "${var}"
+				;;
+			esac
+		done < /etc/rctl.conf
+	fi
+}
+
+rctl_stop()
+{
+
+	rctl -r :
+}
+
+load_rc_config $name
+run_rc_command "$1"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103301832.p2UIWjH0071775>