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/

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"
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to