Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Mar 2019 21:33:14 -0700
From:      Cy Schubert <Cy.Schubert@cschubert.com>
To:        Hiroki Sato <hrs@FreeBSD.org>
Cc:        cy@FreeBSD.org, 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:  <201903230433.x2N4XEni013859@slippy.cwsent.com>
In-Reply-To: Message from Hiroki Sato <hrs@FreeBSD.org> of "Sat, 23 Mar 2019 12:58:53 %2B0900." <20190323.125853.93885646440204179.hrs@allbsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20190323.125853.93885646440204179.hrs@allbsd.org>, Hiroki 
Sato writ
es:
> ----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	(r34540
> 0)
> 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}"
>  }
> ----

Thanks for this. Fixed.


-- 
Cheers,
Cy Schubert <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  http://www.FreeBSD.org

	The need of the many outweighs the greed of the few.





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