From owner-svn-src-head@FreeBSD.ORG Wed Mar 30 18:32:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 664D11065676; Wed, 30 Mar 2011 18:32:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53AF58FC16; Wed, 30 Mar 2011 18:32:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2UIWjK5071778; Wed, 30 Mar 2011 18:32:45 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2UIWjH0071775; Wed, 30 Mar 2011 18:32:45 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201103301832.p2UIWjH0071775@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 30 Mar 2011 18:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220167 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2011 18:32:45 -0000 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"