From owner-svn-src-head@freebsd.org Sat Mar 23 04:00:16 2019 Return-Path: Delivered-To: svn-src-head@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 C1A32155D55C; Sat, 23 Mar 2019 04:00:16 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (mx-int.allbsd.org [IPv6:2001:2f0:104:e002::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.allbsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BD9A747CB; Sat, 23 Mar 2019 04:00:16 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail-d.allbsd.org ([IPv6:2409:11:a740:4700:58:65ff:fe00:b0b]) (authenticated bits=56) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id x2N3xhlq074382 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) (Client CN "/CN=mail.allbsd.org", Issuer "/C=US/O=Let's+20Encrypt/CN=Let's+20Encrypt+20Authority+20X3"); Sat, 23 Mar 2019 12:59:58 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from alph.d.allbsd.org ([IPv6:2409:11:a740:4700:16:ceff:fe34:2700]) by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id x2N3xcTw017142 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 23 Mar 2019 12:59:38 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [[UNIX: localhost]]) (authenticated bits=0) by alph.d.allbsd.org (8.15.2/8.15.2) with ESMTPA id x2N3xa2A017139; Sat, 23 Mar 2019 12:59:38 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Sat, 23 Mar 2019 12:58:53 +0900 (JST) Message-Id: <20190323.125853.93885646440204179.hrs@allbsd.org> To: cy@FreeBSD.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345400 - in head/libexec/rc: . rc.d From: Hiroki Sato In-Reply-To: <201903220130.x2M1Uq0p042374@repo.freebsd.org> References: <201903220130.x2M1Uq0p042374@repo.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Sat_Mar_23_12_58_53_2019_110)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.allbsd.org [IPv6:2001:2f0:104:e001:0:0:0:41]); Sat, 23 Mar 2019 13:00:08 +0900 (JST) X-Spam-Status: No, score=-96.4 required=13.0 tests=CONTENT_TYPE_PRESENT, QENCPTR1,RCVD_IN_AHBL,RCVD_IN_AHBL_PROXY,RCVD_IN_AHBL_SPAM,RDNS_NONE, SPF_SOFTFAIL,UNPARSEABLE_RELAY,USER_IN_WHITELIST autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mx.allbsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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: Sat, 23 Mar 2019 04:00:17 -0000 ----Security_Multipart(Sat_Mar_23_12_58_53_2019_110)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cy Schubert wrote in <201903220130.x2M1Uq0p042374@repo.freebsd.org>: cy> Author: cy cy> Date: Fri Mar 22 01:30:51 2019 cy> New Revision: 345400 cy> URL: https://svnweb.freebsd.org/changeset/base/345400 cy> cy> Log: cy> Add rc.d support for ippool(8). cy> cy> I've been using ippool at my site for approximately two years. It's cy> about time this was committed. cy> cy> PR: 218433 cy> MFC after: 2 weeks cy> Added: head/libexec/rc/rc.d/ippool cy> ============================================================================== cy> --- /dev/null 00:00:00 1970 (empty, because file is newly added) cy> +++ head/libexec/rc/rc.d/ippool Fri Mar 22 01:30:51 2019 (r345400) cy> @@ -0,0 +1,40 @@ cy> +#!/bin/sh cy> +# cy> +# $FreeBSD$ cy> +# cy> + cy> +# PROVIDE: ippool cy> +# REQUIRE: FILESYSTEMS cy> +# BEFORE: ipfilter cy> +# KEYWORD: nojail cy> + cy> +. /etc/rc.subr cy> + cy> +name="ippool" cy> +desc="user interface to the IPFilter pools" cy> +rcvar="ippool_enable" cy> +load_rc_config $name cy> +start_cmd="ippool_start" cy> +stop_cmd="${ippool_program} -F" cy> +reload_cmd="ippool_reload" cy> +extra_commands="reload" cy> +required_files="${ippool_rules}" cy> +required_modules="ipl:ipfilter" cy> + cy> +ippool_start() cy> +{ cy> + if [ -r "${ippool_rules}" ]; then cy> + echo "Loading IP Pools." cy> + ${ippool_program} -f ${ippool_rules} ${ippool_flags} cy> + fi This conditional is redundant. $required_files will check readability of $ippool_rules. And if you want to add a flag, use of precmd is the right way like the following: ---- start_precmd="ippool_start_precmd" ippool_start_precmd() { rc_flags="-f ${ippool_rules} ${rc_flags}" } ---- -- Hiroki ----Security_Multipart(Sat_Mar_23_12_58_53_2019_110)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iEYEABECAAYFAlyVrv0ACgkQTyzT2CeTzy3KRgCeNS2SVXbMaxnNW943I/GeilIK RxIAoIKzy+RLkcZrKxapM1oiYNbajFMi =Ay7D -----END PGP SIGNATURE----- ----Security_Multipart(Sat_Mar_23_12_58_53_2019_110)----