Date: Tue, 05 Jul 2011 15:22:16 -0700 From: Doug Barton <dougb@FreeBSD.org> To: Boris Samorodov <bsam@FreeBSD.org> Cc: cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org, ports-committers@FreeBSD.org Subject: Re: cvs commit: ports/multimedia/zoneminder Makefile ports/multimedia/zoneminder/files zm.in Message-ID: <4E138E98.5050307@FreeBSD.org> In-Reply-To: <201107052153.p65LreBH019263@repoman.freebsd.org> References: <201107052153.p65LreBH019263@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------060505010103080402050009 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit This script has numerous problems, including 2 serious ones. The most serious being that the change you just made is not valid, you need {} to enclose a function definition, not (). Also, it's totally unacceptable for an rc.d script to have an unconditional 'sleep'. Also, we prefer the name of the script file, PROVIDE, and $name to all match, and in the case of a port rc.d script they should be equal to the portname unless there is a good reason not to do so. The attached patch is against zm.in, but this should be changed to zoneminder.in after the patch is applied, and the corresponding changes made to the Makefile. The other changes in the patch: 1. You have 2 instances of load_rc_config. I've moved only one of them up to the proper location, and deleted the other. 2. Minor whitespace issues. hth, Doug On 07/05/2011 14:53, Boris Samorodov wrote: > bsam 2011-07-05 21:53:40 UTC > > FreeBSD ports repository > > Modified files: > multimedia/zoneminder Makefile > multimedia/zoneminder/files zm.in > Log: > . create status_cmd (rc.d script with option status should work now); > . bump PORTREVISION. > > Reported by: achix (at zoneminder forum) > > Revision Changes Path > 1.18 +1 -1 ports/multimedia/zoneminder/Makefile > 1.2 +6 -1 ports/multimedia/zoneminder/files/zm.in > > http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/multimedia/zoneminder/Makefile.diff?&r1=1.17&r2=1.18&f=h > http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/multimedia/zoneminder/files/zm.in.diff?&r1=1.1&r2=1.2&f=h > -- 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/ --------------060505010103080402050009 Content-Type: text/plain; name="zoneminder-rcd.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="zoneminder-rcd.diff" Index: zm.in =================================================================== RCS file: /home/pcvs/ports/multimedia/zoneminder/files/zm.in,v retrieving revision 1.2 diff -u -r1.2 zm.in --- zm.in 5 Jul 2011 21:53:40 -0000 1.2 +++ zm.in 5 Jul 2011 22:16:26 -0000 @@ -1,44 +1,38 @@ #!/bin/sh -# $FreeBSD: ports/multimedia/zoneminder/files/zm.in,v 1.2 2011/07/05 21:53:40 bsam Exp $ - +# $FreeBSD$ +# # PROVIDE: zoneminder # REQUIRE: mysql apache # KEYWORD: shutdown - +# # Add the following line to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # -# zm_enable (bool): Set to NO by default. -# Set it to YES to enable zoneminder. -# +# zoneminder_enable (bool): Set to NO by default. +# Set it to YES to enable zoneminder. . /etc/rc.subr -name="zm" +name="zoneminder" rcvar=${name}_enable -command=%%PREFIX%%/bin/${name}pkg.pl +load_rc_config "$name" +: ${zoneminder_enable="NO"} + +command=%%PREFIX%%/bin/zmpkg.pl command_args="$1" pidfile=/var/run/${name}/${name}.pid -load_rc_config "$name" -: ${zm_enable="NO"} - stop_cmd="zm_stop" status_cmd="zm_status" -load_rc_config "$name" -: ${zm_enable="NO"} - zm_stop() { ${command} ${command_args} } -zm_status() ( +zm_status() { %%PREFIX%%/bin/${name}dc.pl status -) - -sleep 10 +} run_rc_command "$1" --------------060505010103080402050009--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E138E98.5050307>