Date: Sat, 20 Aug 2011 16:22:50 -0700 From: Doug Barton <dougb@FreeBSD.org> To: Chris Rees <utisoft@gmail.com> Cc: freebsd-rc@freebsd.org, Colin Percival <cperciva@freebsd.org> Subject: Re: RC script for spiped (cperciva's latest invention) Message-ID: <4E5041CA.3030108@FreeBSD.org> In-Reply-To: <CADLo83-7zmLvxN3NktvFSas7n1Lv6sOLwqOH9NA5HquYb-Jkag@mail.gmail.com> References: <CADLo83-7zmLvxN3NktvFSas7n1Lv6sOLwqOH9NA5HquYb-Jkag@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------090308050902010701040002 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 08/20/2011 02:41, Chris Rees wrote: > Hi all, > > Colin's submitted a port for his spiped program, with an rc script and > I figure I should get it reviewed after my tweaks. > > Please refer to [1] for the provisional file, and the original PR is at [2]. > > Thanks! > > Chris > > [1] http://www.bayofrum.net/~crees/patches/spiped-rc-script > > [2] http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/159899 Attached is a patch that includes a couple of minor style issues, and more importantly local'izing the variables used in the functions. Otherwise it looks good to me. hth, Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------090308050902010701040002 Content-Type: text/plain; name="spiped-rc-script.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="spiped-rc-script.diff" --- spiped-rc-script.orig 2011-08-20 04:25:09.000000000 -0700 +++ spiped-rc-script 2011-08-20 16:21:17.000000000 -0700 @@ -19,20 +19,22 @@ . /etc/rc.subr name="spiped" -start_cmd="${name}_start" -stop_cmd="${name}_stop" rcvar=${name}_enable -command=%%PREFIX%%/bin/${name} - load_rc_config $name : ${spiped_enable="NO"} +command=%%PREFIX%%/bin/${name} +start_cmd="${name}_start" +stop_cmd="${name}_stop" + spiped_start() { + local P PIDFILE MODE SOURCE TARGET KEY MODEFLAG + for P in ${spiped_pipes}; do - PIDFILE=/var/run/spiped_$P.pid + PIDFILE=/var/run/spiped_${P}.pid eval MODE=\$spiped_pipe_${P}_mode eval SOURCE=\$spiped_pipe_${P}_source eval TARGET=\$spiped_pipe_${P}_target @@ -54,8 +56,10 @@ spiped_stop() { + local P PIDFILE + for P in ${spiped_pipes}; do - PIDFILE=/var/run/spiped_$P.pid + PIDFILE=/var/run/spiped_${P}.pid if [ -f $PIDFILE ] ; then rc_pid=$(check_pidfile $PIDFILE $command) fi --------------090308050902010701040002--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E5041CA.3030108>