Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Mar 2019 12:58:53 +0900 (JST)
From:      Hiroki Sato <hrs@FreeBSD.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
Message-ID:  <20190323.125853.93885646440204179.hrs@allbsd.org>
In-Reply-To: <201903220130.x2M1Uq0p042374@repo.freebsd.org>
References:  <201903220130.x2M1Uq0p042374@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
----Security_Multipart(Sat_Mar_23_12_58_53_2019_110)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Cy Schubert <cy@FreeBSD.org> 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)----



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