Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 646DB65B4 for ; Fri, 15 Jul 2011 07:55:09 +0000 (UTC) Received: (qmail 18337 invoked by uid 500); 15 Jul 2011 07:55:07 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 18125 invoked by uid 500); 15 Jul 2011 07:55:02 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 18023 invoked by uid 99); 15 Jul 2011 07:54:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2011 07:54:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2011 07:54:43 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CC7EC23889B2 for ; Fri, 15 Jul 2011 07:54:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1146997 - /couchdb/trunk/etc/init/couchdb.tpl.in Date: Fri, 15 Jul 2011 07:54:22 -0000 To: commits@couchdb.apache.org From: randall@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110715075422.CC7EC23889B2@eris.apache.org> Author: randall Date: Fri Jul 15 07:54:22 2011 New Revision: 1146997 URL: http://svn.apache.org/viewvc?rev=1146997&view=rev Log: always pass options in init script (COUCHDB-128) Modified: couchdb/trunk/etc/init/couchdb.tpl.in Modified: couchdb/trunk/etc/init/couchdb.tpl.in URL: http://svn.apache.org/viewvc/couchdb/trunk/etc/init/couchdb.tpl.in?rev=1146997&r1=1146996&r2=1146997&view=diff ============================================================================== --- couchdb/trunk/etc/init/couchdb.tpl.in (original) +++ couchdb/trunk/etc/init/couchdb.tpl.in Fri Jul 15 07:54:22 2011 @@ -60,32 +60,19 @@ if test -r $LSB_LIBRARY; then . $LSB_LIBRARY fi -start_couchdb () { - # Start Apache CouchDB as a background process. - - command="$COUCHDB -b" - if test -n "$COUCHDB_STDOUT_FILE"; then - command="$command -o $COUCHDB_STDOUT_FILE" - fi - if test -n "$COUCHDB_STDERR_FILE"; then - command="$command -e $COUCHDB_STDERR_FILE" - fi - if test -n "$COUCHDB_RESPAWN_TIMEOUT"; then - command="$command -r $COUCHDB_RESPAWN_TIMEOUT" - fi +run_command () { + command="$1" if test -n "$COUCHDB_OPTIONS"; then command="$command $COUCHDB_OPTIONS" fi - mkdir -p "$RUN_DIR" if test -n "$COUCHDB_USER"; then - chown $COUCHDB_USER "$RUN_DIR" - if su $COUCHDB_USER -c "$command" > /dev/null; then + if su $COUCHDB_USER -c "$command"; then return $SCRIPT_OK else return $SCRIPT_ERROR fi else - if $command > /dev/null; then + if $command; then return $SCRIPT_OK else return $SCRIPT_ERROR @@ -93,32 +80,33 @@ start_couchdb () { fi } -stop_couchdb () { - # Stop the running Apache CouchDB process. +start_couchdb () { + # Start Apache CouchDB as a background process. - command="$COUCHDB -d" - if test -n "$COUCHDB_OPTIONS"; then - command="$command $COUCHDB_OPTIONS" + mkdir -p "$RUN_DIR" + command="$COUCHDB -b" + if test -n "$COUCHDB_STDOUT_FILE"; then + command="$command -o $COUCHDB_STDOUT_FILE" fi - if test -n "$COUCHDB_USER"; then - if su $COUCHDB_USER -c "$command" > /dev/null; then - return $SCRIPT_OK - else - return $SCRIPT_ERROR - fi - else - if $command > /dev/null; then - return $SCRIPT_OK - else - return $SCRIPT_ERROR - fi + if test -n "$COUCHDB_STDERR_FILE"; then + command="$command -e $COUCHDB_STDERR_FILE" + fi + if test -n "$COUCHDB_RESPAWN_TIMEOUT"; then + command="$command -r $COUCHDB_RESPAWN_TIMEOUT" fi + run_command "$command" > /dev/null +} + +stop_couchdb () { + # Stop the running Apache CouchDB process. + + run_command "$COUCHDB -d" > /dev/null } display_status () { # Display the status of the running Apache CouchDB process. - $COUCHDB -s + run_command "$COUCHDB -s" } parse_script_option_list () {