From owner-cvs-ports@FreeBSD.ORG Wed Aug 31 02:07:19 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 67136106566B; Wed, 31 Aug 2011 02:07:19 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id AB11F14DA47; Wed, 31 Aug 2011 02:07:12 +0000 (UTC) Message-ID: <4E5D974F.4040702@FreeBSD.org> Date: Tue, 30 Aug 2011 19:07:11 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:6.0) Gecko/20110824 Thunderbird/6.0 MIME-Version: 1.0 To: Ashish SHUKLA References: <201108251058.p7PAwlqR007713@repoman.freebsd.org> In-Reply-To: <201108251058.p7PAwlqR007713@repoman.freebsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------030100000808040407040401" Cc: cvs-ports@FreeBSD.org, till@php.net, cvs-all@FreeBSD.org, ports-committers@FreeBSD.org Subject: Re: cvs commit: ports/databases/couchdb Makefile ports/databases/couchdb/files couchdb.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: Wed, 31 Aug 2011 02:07:19 -0000 This is a multi-part message in MIME format. --------------030100000808040407040401 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Attached are some improvements to the rc.d script. Most of them should be obvious, let me know if you have any questions. Doug On 08/25/2011 03:58, Ashish SHUKLA wrote: > ashish 2011-08-25 10:58:47 UTC > > FreeBSD ports repository > > Modified files: > databases/couchdb Makefile > databases/couchdb/files couchdb.in > Log: > - Remove extra USERS/GROUPS, which were accidentally added in previous commit[1] > - Fix rc.d script[1] > - Add option to depend on lang/erlang instead of lang/erlang-lite > > Submitted by: till@php.net[1] > Approved by: till@php.net (maintainer) > > Revision Changes Path > 1.17 +15 -5 ports/databases/couchdb/Makefile > 1.7 +1 -1 ports/databases/couchdb/files/couchdb.in > > http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/databases/couchdb/Makefile.diff?&r1=1.16&r2=1.17&f=h > http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/databases/couchdb/files/couchdb.in.diff?&r1=1.6&r2=1.7&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/ --------------030100000808040407040401 Content-Type: text/plain; name="couchdb.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="couchdb.diff" Index: Makefile =================================================================== RCS file: /home/pcvs/ports/databases/couchdb/Makefile,v retrieving revision 1.17 diff -u -r1.17 Makefile --- Makefile 25 Aug 2011 10:58:47 -0000 1.17 +++ Makefile 31 Aug 2011 02:04:24 -0000 @@ -8,7 +8,7 @@ PORTNAME= couchdb PORTVERSION= 1.1.0 PORTEPOCH= 1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= databases MASTER_SITES= ${MASTER_SITE_APACHE} MASTER_SITE_SUBDIR= couchdb/${PORTVERSION} Index: files/couchdb.in =================================================================== RCS file: /home/pcvs/ports/databases/couchdb/files/couchdb.in,v retrieving revision 1.7 diff -u -r1.7 couchdb.in --- files/couchdb.in 25 Aug 2011 10:58:47 -0000 1.7 +++ files/couchdb.in 31 Aug 2011 02:04:24 -0000 @@ -1,7 +1,10 @@ #!/bin/sh +# $FreeBSD$ +# # PROVIDE: couchdb # REQUIRE: LOGIN +# KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: @@ -16,12 +19,6 @@ # # couchdb_respawn (int): Set to none by default. If CouchDB crashes, # respawn after this many seconds. -# - -couchdb_user="${couchdb_user:-"couchdb"}" -couchdb_enablelogs="${couchdb_enablelogs:-"YES"}" -couchdb_etcdir="${couchdb_etcdir:-"%%PREFIX%%/etc/couchdb"}" -couchdb_respawn="${couchdb_respawn:-"0"}" . /etc/rc.subr @@ -30,35 +27,38 @@ load_rc_config $name +: ${couchdb_enable="NO"} +couchdb_user="${couchdb_user:-"couchdb"}" +couchdb_enablelogs="${couchdb_enablelogs:-"YES"}" +couchdb_etcdir="${couchdb_etcdir:-"%%PREFIX%%/etc/couchdb"}" +couchdb_respawn="${couchdb_respawn:-"0"}" + command="%%PREFIX%%/bin/${name}" pidfile="/var/run/${name}/${name}.pid" -etcdir="%%PREFIX%%/etc/${name}" -if [ "$couchdb_respawn" -gt 0 ] - then - respawn="-r ${couchdb_respawn} " -fi - -if [ "$couchdb_enablelogs" = "YES" ] - then - logfile=/var/log/${name}/couch.log - errfile=/var/log/${name}/err.log - else - logfile=/dev/null - errfile=/dev/null -fi +couchdb_prestart() +{ + install -o $couchdb_user /dev/null $pidfile -: ${couchdb_enable="NO"} -: ${couchdb_flags="-b -a ${etcdir}/default.ini -a ${etcdir}/local.ini ${respawn}-o ${logfile} -e ${errfile} -p ${pidfile}"} + [ -n "$couchdb_flags" ] && return 0 -start_precmd=pid_touch -stop_cmd="${command} -d" -status_cmd="${command} -s" + if [ $couchdb_respawn -gt 0 ]; then + respawn="-r ${couchdb_respawn}" + fi + + if checkyesno couchdb_enablelogs; then + logfile=/var/log/${name}/couch.log + errfile=/var/log/${name}/err.log + else + logfile=/dev/null + errfile=/dev/null + fi -pid_touch () -{ - touch $pidfile - chown $couchdb_user $pidfile + couchdb_flags="-b -a ${couchdb_etcdir}/default.ini -a ${couchdb_etcdir}/local.ini ${respawn} -o ${logfile} -e ${errfile} -p ${pidfile}" } +start_precmd=${name}_prestart +stop_cmd="${command} -d" +status_cmd="${command} -s" + run_rc_command "$1" --------------030100000808040407040401--