From owner-svn-src-all@freebsd.org Fri Mar 22 05:17:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93113155A8EB; Fri, 22 Mar 2019 05:17:14 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA40E6A5A4; Fri, 22 Mar 2019 05:17:13 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x2M5HBlZ063639; Thu, 21 Mar 2019 22:17:11 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x2M5HBqg063638; Thu, 21 Mar 2019 22:17:11 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201903220517.x2M5HBqg063638@gndrsh.dnsmgr.net> Subject: Re: svn commit: r345400 - in head/libexec/rc: . rc.d In-Reply-To: <201903220130.x2M1Uq0p042374@repo.freebsd.org> To: Cy Schubert Date: Thu, 21 Mar 2019 22:17:11 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: EA40E6A5A4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.89 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.89)[-0.889,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2019 05:17:14 -0000 > Author: cy > Date: Fri Mar 22 01:30:51 2019 > New Revision: 345400 > URL: https://svnweb.freebsd.org/changeset/base/345400 > > Log: > Add rc.d support for ippool(8). > > I've been using ippool at my site for approximately two years. It's > about time this was committed. > > PR: 218433 > MFC after: 2 weeks > > Added: > head/libexec/rc/rc.d/ippool (contents, props changed) > Modified: > head/libexec/rc/rc.conf > > Modified: head/libexec/rc/rc.conf > ============================================================================== > --- head/libexec/rc/rc.conf Thu Mar 21 23:31:10 2019 (r345399) > +++ head/libexec/rc/rc.conf Fri Mar 22 01:30:51 2019 (r345400) > @@ -196,6 +196,10 @@ ipfilter_program="/sbin/ipf" # where the ipfilter prog > ipfilter_rules="/etc/ipf.rules" # rules definition file for ipfilter, see > # /usr/src/contrib/ipfilter/rules for examples > ipfilter_flags="" # additional flags for ipfilter > +ippool_enable="NO" # Set to YES to enable ip filter pools > +ippool_program="/sbin/ippool" # where the ippool program lives > +ippool_rules="/etc/ippool.tables" # rules definition file for ippool > +ippool_flags="" # additional flags for ippool > ipnat_enable="NO" # Set to YES to enable ipnat functionality > ipnat_program="/sbin/ipnat" # where the ipnat program lives > ipnat_rules="/etc/ipnat.rules" # rules definition file for ipnat > > Added: head/libexec/rc/rc.d/ippool > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/libexec/rc/rc.d/ippool Fri Mar 22 01:30:51 2019 (r345400) > @@ -0,0 +1,40 @@ > +#!/bin/sh > +# > +# $FreeBSD$ > +# > + > +# PROVIDE: ippool > +# REQUIRE: FILESYSTEMS > +# BEFORE: ipfilter > +# KEYWORD: nojail > + > +. /etc/rc.subr > + > +name="ippool" > +desc="user interface to the IPFilter pools" > +rcvar="ippool_enable" > +load_rc_config $name > +start_cmd="ippool_start" > +stop_cmd="${ippool_program} -F" > +reload_cmd="ippool_reload" > +extra_commands="reload" > +required_files="${ippool_rules}" > +required_modules="ipl:ipfilter" > + > +ippool_start() > +{ > + if [ -r "${ippool_rules}" ]; then > + echo "Loading IP Pools." > + ${ippool_program} -f ${ippool_rules} ${ippool_flags} > + fi > +} > + > +ippool_reload() > +{ > + echo "Reloading IP Pools." > + ${ippool_program} -F > + ippool_start Couldnt this better be expressed ${stop_cmd} ${start_cmd} > +} > + > + > +run_rc_command "$1" > > -- Rod Grimes rgrimes@freebsd.org