Date: Thu, 19 Aug 2010 12:59:38 -0700 From: Doug Barton <dougb@FreeBSD.org> To: Wesley Shields <wxs@FreeBSD.org> Cc: cvs-ports@FreeBSD.org, Till Klampaeckel <till@php.net>, cvs-all@FreeBSD.org, ports-committers@FreeBSD.org Subject: Re: cvs commit: ports/databases/couchdb Makefile distinfo pkg-plist ports/databases/couchdb/files couchdb.in Message-ID: <4C6D8D2A.8050602@FreeBSD.org> In-Reply-To: <201008180008.o7I08CGR014026@repoman.freebsd.org> References: <201008180008.o7I08CGR014026@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Attached is a re-tooled version of the rc.d script that moves things around into a more standardized format. The big changes are adding KEYWORD: shutdown (which should be done for scripts that start persistent services), and not unconditionally running the code to tweak the flags. Enjoy, Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso [-- Attachment #2 --] #!/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: # # couchdb_enable (bool): Set to NO by default. # Set it to YES to enable couchdb. # # couchdb_enablelogs (bool): Set to YES by default. # # couchdb_etcdir (string): In case you want another dir # for default.ini/local.ini. # # couchdb_respawn (int): Set to none by default. If CouchDB crashes, # respawn after this many seconds. . /etc/rc.subr name="couchdb" rcvar=${name}_enable command="%%PREFIX%%/bin/${name}" pidfile="/var/run/${name}/${name}.pid" etcdir="%%PREFIX%%/etc/${name}" start_precmd=${name}_prestart stop_cmd="${command} -d && rm -f ${pidfile}" status_cmd="${command} -s" couchdb_prestart() { 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 touch $pidfile chown $couchdb_user $pidfile } load_rc_config $name : ${couchdb_enable="NO"} : ${couchdb_respawn:-"0"}" : ${couchdb_user:-"couchdb"}" : ${couchdb_enablelogs:-"YES"}" : ${couchdb_etcdir:-"%%PREFIX%%/etc/couchdb"}" : ${couchdb_flags="-b -a ${etcdir}/default.ini -a ${etcdir}/local.ini ${respawn}-o ${logfile} -e ${errfile} -p ${pidfile}"} run_rc_command "$1"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C6D8D2A.8050602>
