From owner-cvs-ports@FreeBSD.ORG Tue Jul 5 22:22:17 2011 Return-Path: Delivered-To: cvs-ports@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 0F6CE1065673; Tue, 5 Jul 2011 22:22:17 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-4.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 6200E150953; Tue, 5 Jul 2011 22:22:16 +0000 (UTC) Message-ID: <4E138E98.5050307@FreeBSD.org> Date: Tue, 05 Jul 2011 15:22:16 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.18) Gecko/20110624 Thunderbird/3.1.11 MIME-Version: 1.0 To: Boris Samorodov References: <201107052153.p65LreBH019263@repoman.freebsd.org> In-Reply-To: <201107052153.p65LreBH019263@repoman.freebsd.org> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------060505010103080402050009" 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 X-BeenThere: cvs-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 22:22:17 -0000 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--