cvs commit: ports GIDs UIDs ports/net Makefile ports/net/minidlna Makefile distinfo pkg-descr pkg-plist ports/net/minidlna/files BSDmakefile config.h getifaddr.c minidlna.sh.in patch-2928850 patch-aa patch-ab patch-inline patch-minidlna.c patch-upnphttp ...

Doug Barton dougb at FreeBSD.org
Fri Dec 17 21:15:58 UTC 2010


With all due respect, you should not have committed this rc.d script in 
its current condition. If you were having difficulty there are numerous 
resources available, starting with 
http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/rc-scripts.html 
and including your fellow developers, the -ports list, and the -rc list.

In no particular order, new rc.d scripts should not be added with the 
.sh extension. I've attached a patch to the current version, but when 
the final result is committed it should be minidlna.in.

1. Scripts that run as non-root users should REQUIRE: LOGIN
2. Scripts that start services should have KEYWORD: shutdown
3. Default variable assignments should come after load_rc_config
4. The rmpid method isn't really needed, although this is a minor issue
5. command_args shouldn't include itself


hth,

Doug


On 12/13/2010 22:11, Mikhail Teterin wrote:
> mi          2010-12-14 06:11:04 UTC
>
>    FreeBSD ports repository
>
>    Modified files:
>      .                    UIDs GIDs
>      net                  Makefile
>    Added files:
>      net/minidlna         Makefile distinfo pkg-descr pkg-plist
>      net/minidlna/files   BSDmakefile config.h getifaddr.c
>                           minidlna.sh.in patch-2928850 patch-aa
>                           patch-ab patch-inline patch-minidlna.c
>                           patch-upnphttp pkg-message.in
>                           scandir-patch
>    Log:
>    Add the port of minidlna -- the DLNA-speaking service.
>    (Took me 6 months to come up with the etc/rc.d/ script...)
>
>    Revision  Changes    Path
>    1.118     +2 -1      ports/GIDs
>    1.131     +2 -1      ports/UIDs
>    1.2297    +1 -0      ports/net/Makefile
>    1.1       +49 -0     ports/net/minidlna/Makefile (new)
>    1.1       +2 -0      ports/net/minidlna/distinfo (new)
>    1.1       +36 -0     ports/net/minidlna/files/BSDmakefile (new)
>    1.1       +34 -0     ports/net/minidlna/files/config.h (new)
>    1.1       +327 -0    ports/net/minidlna/files/getifaddr.c (new)
>    1.1       +34 -0     ports/net/minidlna/files/minidlna.sh.in (new)
>    1.1       +639 -0    ports/net/minidlna/files/patch-2928850 (new)
>    1.1       +11 -0     ports/net/minidlna/files/patch-aa (new)
>    1.1       +9 -0      ports/net/minidlna/files/patch-ab (new)
>    1.1       +23 -0     ports/net/minidlna/files/patch-inline (new)
>    1.1       +72 -0     ports/net/minidlna/files/patch-minidlna.c (new)
>    1.1       +95 -0     ports/net/minidlna/files/patch-upnphttp (new)
>    1.1       +5 -0      ports/net/minidlna/files/pkg-message.in (new)
>    1.1       +38 -0     ports/net/minidlna/files/scandir-patch (new)
>    1.1       +10 -0     ports/net/minidlna/pkg-descr (new)
>    1.1       +4 -0      ports/net/minidlna/pkg-plist (new)
>
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/GIDs.diff?&r1=1.117&r2=1.118&f=h
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/UIDs.diff?&r1=1.130&r2=1.131&f=h
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/Makefile.diff?&r1=1.2296&r2=1.2297&f=h
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/Makefile
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/distinfo
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/files/BSDmakefile
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/files/config.h
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/files/getifaddr.c
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/files/minidlna.sh.in
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/files/patch-2928850
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/files/patch-aa
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/files/patch-ab
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/files/patch-inline
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/files/patch-minidlna.c
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/files/patch-upnphttp
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/files/pkg-message.in
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/files/scandir-patch
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/pkg-descr
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/net/minidlna/pkg-plist
>



-- 

	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/

-------------- next part --------------
Index: minidlna.sh.in
===================================================================
RCS file: /home/pcvs/ports/net/minidlna/files/minidlna.sh.in,v
retrieving revision 1.1
diff -u -r1.1 minidlna.sh.in
--- minidlna.sh.in	14 Dec 2010 06:11:04 -0000	1.1
+++ minidlna.sh.in	17 Dec 2010 21:09:17 -0000
@@ -1,34 +1,32 @@
 #!/bin/sh
+
 # $FreeBSD: ports/net/minidlna/files/minidlna.sh.in,v 1.1 2010/12/14 06:11:04 mi Exp $
 #
 # PROVIDE: minidlna
-# REQUIRE: DAEMON
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
 #
 # Add the following line to /etc/rc.conf[.local] to enable minidlna:
 #
 # minidlna_enable="YES"
-#
 
 . /etc/rc.subr
 
-minidlna_enable=${minidlna_enable-"NO"}
-minidlna_uid=${minidlna_uid-"%%USER%%"}
-
 name=minidlna
 rcvar=`set_rcvar`
 command=%%PREFIX%%/sbin/minidlna
 
+load_rc_config $name
+
+minidlna_enable=${minidlna_enable-"NO"}
+minidlna_uid=${minidlna_uid-"%%USER%%"}
+
 pidfile="/var/run/minidlna.pid"
 
-start_precmd=rmpid
-stop_postcmd=rmpid
-rmpid()
-{
-	rm -f $pidfile
-}
+start_precmd="rm -f $pidfile"
+stop_postcmd="rm -f $pidfile"
 
-load_rc_config $name
-command_args="$command_args -P $pidfile -u $minidlna_uid"
+command_args="-P $pidfile -u $minidlna_uid"
 required_dirs="/var/db/minidlna"
 
 run_rc_command $1


More information about the cvs-ports mailing list