From owner-cvs-all@FreeBSD.ORG Sun Jul 31 09:06:20 2011 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97BAE106564A; Sun, 31 Jul 2011 09:06:20 +0000 (UTC) (envelope-from support@rtmpd.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6F86F8FC13; Sun, 31 Jul 2011 09:06:19 +0000 (UTC) Received: by fxe4 with SMTP id 4so4981646fxe.13 for ; Sun, 31 Jul 2011 02:06:18 -0700 (PDT) Received: by 10.223.101.90 with SMTP id b26mr2620495fao.29.1312103177852; Sun, 31 Jul 2011 02:06:17 -0700 (PDT) Received: from [10.0.1.2] ([79.115.160.60]) by mx.google.com with ESMTPS id 9sm2151044far.37.2011.07.31.02.06.17 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 31 Jul 2011 02:06:17 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: multipart/signed; boundary="Apple-Mail=_9C0747F8-9B05-4162-9932-687849B87015"; protocol="application/pkcs7-signature"; micalg=sha1 From: C++ RTMP Server Support In-Reply-To: <4E3516C3.9070605@FreeBSD.org> Date: Sun, 31 Jul 2011 12:06:16 +0300 Message-Id: <45B5CD7B-75C0-424B-9FCA-DC481373536F@rtmpd.com> References: <201107301549.p6UFn7rK070976@repoman.freebsd.org> <4E3495B0.3070405@FreeBSD.org> <4E35108D.1040907@FreeBSD.org> <4E3510F7.2000405@FreeBSD.org> <7C192122-697C-49BB-AADB-446C24962000@rtmpd.com> <4E3516C3.9070605@FreeBSD.org> To: Doug Barton X-Mailer: Apple Mail (2.1244.3) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jin-Sih Lin , cvs-ports@FreeBSD.org, Li-Wen Hsu , cvs-all@FreeBSD.org, ports-committers@FreeBSD.org Subject: Re: cvs commit: ports/net/crtmpserver Makefile distinfo pkg-plist ports/net/crtmpserver/files crtmpserver.in X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 09:06:20 -0000 --Apple-Mail=_9C0747F8-9B05-4162-9932-687849B87015 Content-Type: multipart/mixed; boundary="Apple-Mail=_EA480425-2AAD-453F-BB8A-47DF4BAA64D0" --Apple-Mail=_EA480425-2AAD-453F-BB8A-47DF4BAA64D0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On Jul 31, 2011, at 11:48 AM, Doug Barton wrote: > On 07/31/2011 01:34, C++ RTMP Server Support wrote: >> Oh, I see the difference now. You basically use another construct to >> gather the (default) values. IMHO, my solution is much much clear >> because all variables which are read from rc.conf are in one single >> place and for beginners like me the script is easier to read. >>=20 >> Besides, you remove one variable (crtmpserver_config) and you put >> it's default value inside the required_files variable, but you add >> another one called pidfile. >>=20 >> Again, IMHO, my version is easier to read.=20 >=20 > You still don't understand. >=20 > pidfile=3D is a requirement. As I said in my first message, it's = special > to rc.subr. This needs to be fixed. >=20 > As for how pidfile=3D and required_files=3D are set, that's a style = issue > that I'm less concerned about. What you are saying is that this is > easier to read: >=20 > : ${name_config:=3Dfoo} > : ${name_pidfile:=3Dbar} >=20 > required_files=3D$name_config > pidfile=3D$name_pidfile >=20 > What I'm saying is that doing it that way means that you're working > harder than you have to. The way I had it in the patch means that each > variable only has to be handled once. It may be slightly more = difficult > to read for novices, but it's not _that_ complex; Well, is complex enough to discern if that variable is yours or needed = by rc.subr Maybe is as natural as breathing for trained people, but for us, = newbies, is definitely not! :) One simple comment line will most definitely save us A LOT of time :) Here is the attached patch along with some comments :) Tx for your time --Apple-Mail=_EA480425-2AAD-453F-BB8A-47DF4BAA64D0 Content-Disposition: attachment; filename=crtmpserver.patch Content-Type: application/octet-stream; name="crtmpserver.patch" Content-Transfer-Encoding: 7bit diff -ur ./Makefile /tmp/crtmpserver/Makefile --- ./Makefile 2011-07-30 18:49:06.000000000 +0300 +++ /tmp/crtmpserver/Makefile 2011-07-31 14:52:11.000000000 +0300 @@ -7,6 +7,7 @@ PORTNAME= crtmpserver PORTVERSION= 0.545 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= http://rtmpd.com/assets/sources/ diff -ur ./files/crtmpserver.in /tmp/crtmpserver/files/crtmpserver.in --- ./files/crtmpserver.in 2011-07-30 18:49:07.000000000 +0300 +++ /tmp/crtmpserver/files/crtmpserver.in 2011-07-31 14:52:11.000000000 +0300 @@ -15,25 +15,28 @@ # by default. # crtmpserver_username (username): Set to crtmpserver # by default. +# crtmpserver_pidfile (the pid file): Set to +# /var/run/crtmpserver.pid by default . /etc/rc.subr name="crtmpserver" rcvar=${name}_enable -command=%%PREFIX%%/sbin/${name} - +#load the rc.conf variables load_rc_config $name - : ${crtmpserver_enable="NO"} : ${crtmpserver_config="%%PREFIX%%/etc/crtmpserver.lua"} : ${crtmpserver_username="crtmpserver"} : ${crtmpserver_groupname="crtmpserver"} : ${crtmpserver_pidfile="/var/run/${name}.pid"} -required_files="$crtmpserver_config" - +#compute the variables needed by rc.subr +required_files="${crtmpserver_config}" +pidfile="${crtmpserver_pidfile}" +command=%%PREFIX%%/sbin/${name} command_args="--daemon --uid=`id -u ${crtmpserver_username}` --gid=`pw groupshow ${crtmpserver_groupname} | awk -F ":" '{print $3}'` --pid=${crtmpserver_pidfile} $required_files" +#run the command run_rc_command "$1" --Apple-Mail=_EA480425-2AAD-453F-BB8A-47DF4BAA64D0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=iso-8859-1 > and reduces the > chances that a mistake will be made. However, if you choose not to use > the style that I suggested, I'm not too concerned about that. > > However, the pidfile issue has to be fixed. > > > 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/ > ------ C++ RTMP Server Support Email: support@rtmpd.com Web: http://www.rtmpd.com --Apple-Mail=_EA480425-2AAD-453F-BB8A-47DF4BAA64D0-- --Apple-Mail=_9C0747F8-9B05-4162-9932-687849B87015--