summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2014-07-10 15:28:53 +0100
committerRobert Newson <rnewson@apache.org>2014-07-10 15:49:00 +0100
commit65260510eff0479ac9d1cb8e68e9aa8619f39d1b (patch)
tree862fad8ef5b527c49f3ce920c61e9d3436367d1e /bin
parentade9dae2311b43b9c742d7a94ce0159416ebba0f (diff)
parent86f68c91d763e3eda3cea61cb1830e53266d8d22 (diff)
downloadcouchdb-65260510eff0479ac9d1cb8e68e9aa8619f39d1b.tar.gz
Merge branch '1843-feature-bigcouch'
Diffstat (limited to 'bin')
-rw-r--r--bin/Makefile.am159
-rw-r--r--bin/couch-config.tpl.in140
-rw-r--r--bin/couchdb.bat.tpl.in26
-rw-r--r--bin/couchdb.tpl.in385
4 files changed, 0 insertions, 710 deletions
diff --git a/bin/Makefile.am b/bin/Makefile.am
deleted file mode 100644
index aeb095369..000000000
--- a/bin/Makefile.am
+++ /dev/null
@@ -1,159 +0,0 @@
-## Licensed under the Apache License, Version 2.0 (the "License"); you may not
-## use this file except in compliance with the License. You may obtain a copy of
-## the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-## License for the specific language governing permissions and limitations under
-## the License.
-
-MAKE_SAFE = $(MAKE)
-
-if WINDOWS
-bin_SCRIPTS = couchdb.bat
-else
-bin_SCRIPTS = couchdb couch-config
-endif
-
-man1dir = $(mandir)/man1
-
-noinst_SCRIPTS = couchjs_dev couch-config_dev
-
-man_file = couchdb.1
-
-if BUILD_MAN
-man_file_build = $(man_file)
-else
-man_file_build =
-endif
-
-BUILT_SOURCES = $(man_file_build)
-
-EXTRA_DIST = $(man_file_build) erlang-version.escript
-
-CLEANFILES = $(bin_SCRIPTS) $(man_file_build) $(noinst_SCRIPTS)
-
-transform = @program_transform_name@
-couchdb_command_name = `echo couchdb | sed '$(transform)'`
-couchjs_command_name = `echo couchjs | sed '$(transform)'`
-
-couchdb: couchdb.tpl
- sed -e "s|%ERL%|$(ERL)|g" \
- -e "s|%ICU_CONFIG%|$(ICU_CONFIG)|g" \
- -e "s|%bindir%|@bindir@|g" \
- -e "s|%localerlanglibdir%|@localerlanglibdir@|g" \
- -e "s|%defaultini%|default.ini|g" \
- -e "s|%localini%|local.ini|g" \
- -e "s|%localconfdir%|@localconfdir@|g" \
- -e "s|%localstatelogdir%|@localstatelogdir@|g" \
- -e "s|%localstatelibdir%|@localstatelibdir@|g" \
- -e "s|%localstatedir%|@localstatedir@|g" \
- -e "s|%locallibdir%|@locallibdir@|g" \
- -e "s|%bug_uri%|@bug_uri@|g" \
- -e "s|%package_author_address%|@package_author_address@|g" \
- -e "s|%package_author_name%|@package_author_name@|g" \
- -e "s|%package_name%|@package_name@|g" \
- -e "s|%version%|@version@|g" \
- -e "s|%couchdb_command_name%|$(couchdb_command_name)|g" > \
- $@ < $<
- chmod +x $@
-
-if !WINDOWS
-install-exec-hook:
- $(LN_S) -f "$(locallibbindir)/$(couchjs_command_name)" \
- "$(DESTDIR)$(bindir)/$(couchjs_command_name)"
-endif
-
-couchjs_dev:
- $(LN_S) -f "$(abs_top_builddir)/src/couchdb/priv/couchjs" "$@"
-
-couchdb.bat: couchdb.bat.tpl
- sed -e "s|%ICU_CONFIG%|$(ICU_CONFIG)|g" \
- -e "s|%version%|@version@|g" \
- $< > $@
-
-couch-config: couch-config.tpl
- sed -e "s|%ERL%|$(ERL)|g" \
- -e "s|%bindir%|@bindir@|g" \
- -e "s|%localerlanglibdir%|@localerlanglibdir@|g" \
- -e "s|%localconfdir%|@localconfdir@|g" \
- -e "s|%localdatadir%|$(localdatadir)|g" \
- -e "s|%localbuilddatadir%|$(localdatadir)|g" \
- -e "s|%localstatelogdir%|@localstatelogdir@|g" \
- -e "s|%localstatelibdir%|@localstatelibdir@|g" \
- -e "s|%localstatedir%|@localstatedir@|g" \
- -e "s|%localstaterundir%|@localstaterundir@|g" \
- -e "s|%couchlibdir%|@localerlanglibdir@/couch-%version%|g"\
- -e "s|%couchincludedir%|@localerlanglibdir@/include|g"\
- -e "s|%couchebindir%|@localerlanglibdir@/ebin|g"\
- -e "s|%couchprivlibdir%|@localerlanglibdir@/couch-%version%/priv/lib|g"\
- -e "s|%bug_uri%|@bug_uri@|g" \
- -e "s|%package_author_address%|@package_author_address@|g" \
- -e "s|%package_author_name%|@package_author_name@|g" \
- -e "s|%package_name%|@package_name@|g" \
- -e "s|%version%|@version@|g" \
- -e "s|%erlangversion%|@erlangversion@|g" \
- -e "s|%erlangbin%|@erlangbin@|g" \
- -e "s|%couchdb_command_name%|$(couchdb_command_name)|g" > \
- $@ < $<
- chmod +x $@
-
-couch-config_dev: couch-config.tpl
- sed -e "s|%ERL%|$(ERL)|g" \
- -e "s|%bindir%|$(abs_top_builddir)/bin|g" \
- -e "s|%localerlanglibdir%|$(abs_top_builddir)\/src\/couchdb|g" \
- -e "s|%couchlibdir%|$(abs_top_builddir)\/src\/couchdb|g"\
- -e "s|%couchincludedir%|$(abs_top_builddir)\/src\/couchdb|g"\
- -e "s|%couchebindir%|$(abs_top_builddir)\/src\/couchdb|g"\
- -e "s|%couchprivlibdir%|$(abs_top_builddir)/src/couchdb/priv/.libs|g"\
- -e "s|%localdatadir%|$(abs_top_srcdir)/share|g" \
- -e "s|%localbuilddatadir%|$(abs_top_builddir)/share|g" \
- -e "s|%localstatelibdir%|$(abs_top_builddir)/tmp/lib|g" \
- -e "s|%localstatelogdir%|$(abs_top_builddir)/tmp/log|g" \
- -e "s|%localstatedir%|$(abs_top_builddir)/tmp|g" \
- -e "s|%localstaterundir%|$(abs_top_builddir)/tmp/run|g" \
- -e "s|%bug_uri%|@bug_uri@|g" \
- -e "s|%package_author_address%|@package_author_address@|g" \
- -e "s|%package_author_name%|@package_author_name@|g" \
- -e "s|%package_name%|@package_name@|g" \
- -e "s|%version%|@version@|g" \
- -e "s|%erlangversion%|@erlangversion@|g" \
- -e "s|%erlangbin%|@erlangbin@|g" \
- -e "s|%couchdb_command_name%|$(abs_top_builddir)/utils/run|g" > \
- $@ < $<
- chmod +x $@
-
-# Depend on source files so distributed man pages are not rebuilt for end user.
-
-$(man_file): couchdb.tpl.in
- $(MAKE_SAFE) -f Makefile couchdb; \
- $(top_srcdir)/build-aux/missing --run \
- help2man \
- --no-info \
- --help-option="-h" \
- --version-option="-V" \
- --name="$(package_name) database server" \
- ./couchdb --output $@
-
-install-data-local:
- if test -s $(man_file); then \
- if test `cat $(man_file) | wc -l` -gt 1; then \
- $(INSTALL) -d $(DESTDIR)$(man1dir); \
- $(INSTALL_DATA) $(man_file) $(DESTDIR)$(man1dir)/$(man_file); \
- fi \
- fi
-
-uninstall-local:
- rm -f $(DESTDIR)$(man1dir)/$(man_file)
-
-distcheck-hook:
- if test ! -s $(man_file); then \
- $(top_srcdir)/build-aux/dist-error $(man_file); \
- else \
- if test ! `cat $(man_file) | wc -l` -gt 1; then \
- $(top_srcdir)/build-aux/dist-error $(man_file); \
- fi \
- fi
diff --git a/bin/couch-config.tpl.in b/bin/couch-config.tpl.in
deleted file mode 100644
index bd27d0e19..000000000
--- a/bin/couch-config.tpl.in
+++ /dev/null
@@ -1,140 +0,0 @@
-#! /bin/sh -e
-
-# Licensed under the Apache License, Version 2.0 (the "License"); you
-# may not use this file except in compliance with the License. You may
-# obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# permissions and limitations under the License.
-
-basename=`basename "$0"`
-
-staticdir="%localbuilddatadir%"
-erlanglibdir="%localerlanglibdir%"
-couchversion="%version%"
-dbdir="%localstatelibdir%"
-viewdir="%localstatelibdir%"
-confdir="%localconfdir%"
-urifile="%localstaterundir%/couch.uri"
-logdir="%localstatelogdir%"
-erlangversion="%erlangversion%"
-erlangbin="%erlangbin%"
-
-version () {
- cat << EOF
-$basename - %package_name% configuration helper %version%
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
-EOF
-}
-
-usage()
-{
- cat << EOF
-Usage: $basename [OPTION]
-
-The $basename command runs the %package_name% configuration helper
-script.
-
-Options:
-
- --erl-libs-dir Erlang library directory
- --erl-bin Erlang binary
- --config-dir configuration directory
- --db-dir database directory
- --view-dir view index directory
- --static-dir static asset directory
- --doc-dir documentation directory
- --log-dir log directory
- --uri-file daemon sockets file
- --couch-version version of Apache CouchDB
- --erlang-version version of Erlang that CouchDB was built with
- --version version of $basename
- --help Print usage
-
-If you want to add an option in couch-config or report bugs please do it
-at <%bug_uri%>.
-EOF
-}
-
-
-if [ $# -lt 1 ]; then
- usage
- exit 1
-fi
-
-
-while [ $# -gt 0 ];
-do
- arg="$1"
- var=`echo $arg | sed -e 's/^[^=]*=//'`
-
- case "$arg" in
- --erl-libs-dir)
- echo $erlanglibdir
- ;;
- --erl-bin)
- echo $erlangbin
- ;;
- --config-dir)
- echo $confdir
- ;;
- --db-dir)
- echo $dbdir
- ;;
- --view-dir)
- echo $viewdir
- ;;
- --static-dir)
- echo $staticdir
- ;;
- --doc-dir)
- echo $staticdir
- ;;
- --log-dir)
- echo $logdir
- ;;
- --uri-file)
- echo $urifile
- ;;
- --couch-version)
- echo $couchversion
- ;;
- --erlang-version)
- echo $erlangversion
- ;;
- --version)
- version
- exit 0
- ;;
- --help)
- usage
- exit 0
- ;;
- *|-*)
- echo $basename: ERROR Unknown Option $arg 1>&2
- echo 1>&2
- usage 1>&2
- echo "### $basename: Exitting." 1>&2
- exit 1;
- ;;
- esac
- shift
-done
-
-exit 0
diff --git a/bin/couchdb.bat.tpl.in b/bin/couchdb.bat.tpl.in
deleted file mode 100644
index 8718ee69e..000000000
--- a/bin/couchdb.bat.tpl.in
+++ /dev/null
@@ -1,26 +0,0 @@
-@echo off
-rem Licensed under the Apache License, Version 2.0 (the "License"); you may not
-rem use this file except in compliance with the License. You may obtain a copy
-rem of the License at
-rem
-rem http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-rem WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-rem License for the specific language governing permissions and limitations
-rem under the License.
-
-setlocal
-rem First change to the drive with the erlang bin directory
-%~d0
-rem then change to the erlang bin directory
-cd %~dp0
-
-rem Allow a different erlang executable (eg, erl) to be used.
-rem When using erl instead of werl, server restarts during test runs can fail
-rem intermittently. But using erl should be fine for production use.
-if "%ERL%x" == "x" set ERL=werl.exe
-
-echo CouchDB %version% - prepare to relax...
-%ERL% -sasl errlog_type error -s couch +A 4 +W w
diff --git a/bin/couchdb.tpl.in b/bin/couchdb.tpl.in
deleted file mode 100644
index f2027f1ec..000000000
--- a/bin/couchdb.tpl.in
+++ /dev/null
@@ -1,385 +0,0 @@
-#! /bin/sh -e
-
-# Licensed under the Apache License, Version 2.0 (the "License"); you may not
-# use this file except in compliance with the License. You may obtain a copy of
-# the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-
-BACKGROUND=false
-DEFAULT_CONFIG_DIR=%localconfdir%/default.d
-DEFAULT_CONFIG_FILE=%localconfdir%/%defaultini%
-ERL_OS_MON_OPTIONS="-os_mon \
- start_memsup false \
- start_cpu_sup false \
- disk_space_check_interval 1 \
- disk_almost_full_threshold 1"
-ERL_START_OPTIONS="$ERL_OS_MON_OPTIONS -sasl errlog_type error +K true +A 4"
-HEART_BEAT_TIMEOUT=11
-HEART_COMMAND="%bindir%/%couchdb_command_name% -k"
-INTERACTIVE=false
-KILL=false
-PLUGINS_DIR=%locallibdir%/plugins
-LOCAL_CONFIG_DIR=%localconfdir%/local.d
-LOCAL_CONFIG_FILE=%localconfdir%/%localini%
-PID_FILE=%localstatedir%/run/couchdb/couchdb.pid
-RECURSED=false
-RESET_CONFIG=true
-RESPAWN_TIMEOUT=0
-SCRIPT_ERROR=1
-SCRIPT_OK=0
-SHUTDOWN=false
-STDERR_FILE=couchdb.stderr
-STDOUT_FILE=couchdb.stdout
-
-print_arguments=""
-start_arguments=""
-background_start_arguments=""
-
-basename=`basename $0`
-
-display_version () {
- cat << EOF
-$basename - %package_name% %version%
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
-EOF
-}
-
-display_help () {
- cat << EOF
-Usage: $basename [OPTION]
-
-The $basename command runs the %package_name% server.
-
-Erlang is called with:
-
- $ERL_START_OPTIONS
-
-Erlang inherits the environment of this command.
-
-You can override these options using the environment:
-
- ERL_AFLAGS, ERL_FLAGS, ERL_ZFLAGS
-
-See erl(1) for more information about the environment variables.
-
-The exit status is 0 for success or 1 for failure.
-
-Options:
-
- -h display a short help message and exit
- -V display version information and exit
- -a FILE add configuration FILE to chain
- -A DIR add configuration DIR to chain
- -n reset configuration file chain (including system default)
- -c print configuration file chain and exit
- -i use the interactive Erlang shell
- -b spawn as a background process
- -p FILE set the background PID FILE (overrides system default)
- -r SECONDS respawn background process after SECONDS (defaults to no respawn)
- -o FILE redirect background stdout to FILE (defaults to $STDOUT_FILE)
- -e FILE redirect background stderr to FILE (defaults to $STDERR_FILE)
- -s display the status of the background process
- -k kill the background process, will respawn if needed
- -d shutdown the background process
-
-Report bugs at <%bug_uri%>.
-EOF
-}
-
-display_error () {
- if test -n "$1"; then
- echo $1 >&2
- fi
- echo >&2
- echo "Try \`"$basename" -h' for more information." >&2
- false
-}
-
-_get_pid () {
- if test -f $PID_FILE; then
- PID=`cat $PID_FILE`
- fi
- echo $PID
-}
-
-_add_config_file () {
- if test -z "$print_arguments"; then
- print_arguments="$1"
- else
- print_arguments="`cat <<EOF
-$print_arguments
-$1
-EOF
-`"
- fi
- start_arguments="$start_arguments $1"
- background_start_arguments="$background_start_arguments -a $1"
-}
-
-_add_config_dir () {
- for file in "$1"/*.ini; do
- if [ -r "$file" ]; then
- _add_config_file "$file"
- fi
- done
-}
-
-_add_erlang_config () {
- if [ -r "$1" ]; then
- ERL_START_OPTIONS="$ERL_START_OPTIONS -config '$1'"
- fi
-}
-
-_load_config () {
- _add_config_file "$DEFAULT_CONFIG_FILE"
- _add_config_dir "$DEFAULT_CONFIG_DIR"
- # We initialize plugins here to get the desired default config load order
- _find_plugins
- _add_config_file "$LOCAL_CONFIG_FILE"
- _add_config_dir "$LOCAL_CONFIG_DIR"
- if [ "$COUCHDB_ADDITIONAL_CONFIG_FILE" != '' ]
- then
- _add_config_file "$COUCHDB_ADDITIONAL_CONFIG_FILE"
- fi
-}
-
-_reset_config () {
- print_arguments=""
- start_arguments=""
- background_start_arguments="-n"
-}
-
-_print_config () {
- cat <<EOF
-$print_arguments
-EOF
-}
-
-check_status () {
- PID=`_get_pid`
- if test -n "$PID"; then
- if kill -0 $PID 2> /dev/null; then
- echo "Apache CouchDB is running as process $PID, time to relax."
- return $SCRIPT_OK
- else
- echo >&2 << EOF
-Apache CouchDB is not running but a stale PID file exists: $PID_FILE
-EOF
- fi
- else
- echo "Apache CouchDB is not running." >&2
- fi
- return $SCRIPT_ERROR
-}
-
-check_environment () {
- if test "$BACKGROUND" != "true"; then
- return
- fi
- touch $PID_FILE 2> /dev/null || true
- touch $STDOUT_FILE 2> /dev/null || true
- touch $STDERR_FILE 2> /dev/null || true
- message_prefix="Apache CouchDB needs write permission on the"
- if test ! -w $PID_FILE; then
- echo "$message_prefix PID file: $PID_FILE" >&2
- false
- fi
- if test ! -w $STDOUT_FILE; then
- echo "$message_prefix STDOUT file: $STDOUT_FILE" >&2
- false
- fi
- if test ! -w $STDERR_FILE; then
- echo "$message_prefix STDERR file: $STDERR_FILE" >&2
- false
- fi
- message_prefix="Apache CouchDB needs a regular"
- if test `echo 2> /dev/null >> $PID_FILE; echo $?` -gt 0; then
- echo "$message_prefix PID file: $PID_FILE" >&2
- false
- fi
- if test `echo 2> /dev/null >> $STDOUT_FILE; echo $?` -gt 0; then
- echo "$message_prefix STDOUT file: $STDOUT_FILE" >&2
- false
- fi
- if test `echo 2> /dev/null >> $STDERR_FILE; echo $?` -gt 0; then
- echo "$message_prefix STDERR file: $STDERR_FILE" >&2
- false
- fi
-}
-
-_find_plugins () {
- # Find plugins and add them to the Erlang path and load their default
- # configurations. This should be called from _load_config.
- if test -d "$PLUGINS_DIR"; then
- for plugin in "$PLUGINS_DIR"/*; do
- if echo "$COUCH_PLUGIN_BLACKLIST" | grep "$plugin" > /dev/null 2> /dev/null; then
- : # Do not use this plugin.
- else
- if echo "$ERL_ZFLAGS" | grep "$plugin/ebin" > /dev/null 2> /dev/null; then
- : # It's already loaded.
- else
- ERL_ZFLAGS="$ERL_ZFLAGS -pz '$plugin/ebin'"
- fi
- _add_config_dir "$plugin/priv/default.d"
- _add_erlang_config "$plugin/priv/couch_plugin.config"
- fi
- done
- export ERL_ZFLAGS
- fi
-}
-
-start_couchdb () {
- if test ! "$RECURSED" = "true"; then
- if check_status 2> /dev/null; then
- exit
- fi
- check_environment
- fi
- interactive_option="+Bd -noinput"
- if test "$INTERACTIVE" = "true"; then
- interactive_option=""
- fi
- if test "$BACKGROUND" = "true"; then
- touch $PID_FILE
- interactive_option="+Bd -noinput"
- fi
-
- command="%ERL% $interactive_option $ERL_START_OPTIONS \
- -env ERL_LIBS $ERL_LIBS:%localerlanglibdir% -couch_ini $start_arguments -s couch"
- if test "$BACKGROUND" = "true" -a "$RECURSED" = "false"; then
- $0 $background_start_arguments -b -r $RESPAWN_TIMEOUT -p $PID_FILE \
- -o $STDOUT_FILE -e $STDERR_FILE -R &
- echo "Apache CouchDB has started, time to relax."
- else
- if test "$RECURSED" = "true"; then
- # close stdout / stderr
- exec 1>&-
- exec 2>&-
- while true; do
- export HEART_COMMAND
- export HEART_BEAT_TIMEOUT
- `eval $command -pidfile $PID_FILE -heart \
- >> $STDOUT_FILE 2>> $STDERR_FILE` || true
- PID=`_get_pid`
- if test -n "$PID"; then
- if kill -0 $PID 2> /dev/null; then
- return $SCRIPT_ERROR
- fi
- else
- return $SCRIPT_OK
- fi
- if test "$RESPAWN_TIMEOUT" = "0"; then
- return $SCRIPT_OK
- fi
- if test "$RESPAWN_TIMEOUT" != "1"; then
- plural_ending="s"
- fi
- cat << EOF
-Apache CouchDB crashed, restarting in $RESPAWN_TIMEOUT second$plural_ending.
-EOF
- sleep $RESPAWN_TIMEOUT
- done
- else
- eval exec $command
- fi
- fi
-}
-
-stop_couchdb () {
- PID=`_get_pid`
- STOP_TIMEOUT=60
- if test -n "$PID"; then
- if test "$1" = "false"; then
- echo > $PID_FILE
- fi
-
- if kill -0 $PID 2> /dev/null; then
- if kill -TERM $PID 2> /dev/null; then
- count=0
- while kill -0 $PID 2> /dev/null; do
- if [ $count -ge $STOP_TIMEOUT ]; then
- echo "Apache CouchDB failed to shutdown."
- return $SCRIPT_ERROR
- else
- count=$[count+1]
- sleep 1
- fi
- done
- if test "$1" = "false"; then
- echo "Apache CouchDB has been shutdown."
- else
- echo "Apache CouchDB has been killed."
- fi
- return $SCRIPT_OK
- else
- echo "Apache CouchDB could not be killed." >&2
- return $SCRIPT_ERROR
- fi
- if test "$1" = "false"; then
- echo "Stale PID file exists but Apache CouchDB is not running."
- else
- echo "Stale PID file existed but Apache CouchDB is not running."
- fi
- fi
- else
- echo "Apache CouchDB is not running."
- fi
-}
-
-parse_script_option_list () {
- _load_config
- set +e
- options=`getopt hVa:A:ncibp:r:Ro:e:skd $@`
- if test ! $? -eq 0; then
- display_error
- fi
- set -e
- eval set -- $options
- while [ $# -gt 0 ]; do
- case "$1" in
- -h) shift; display_help; exit;;
- -V) shift; display_version; exit;;
- -a) shift; _add_config_file "$1"; shift;;
- -A) shift; _add_config_dir "$1"; shift;;
- -n) shift; _reset_config;;
- -c) shift; _print_config; exit;;
- -i) shift; INTERACTIVE=true;;
- -b) shift; BACKGROUND=true;;
- -r) shift; RESPAWN_TIMEOUT=$1; shift;;
- -R) shift; RECURSED=true;;
- -p) shift; PID_FILE=$1; shift;;
- -o) shift; STDOUT_FILE=$1; shift;;
- -e) shift; STDERR_FILE=$1; shift;;
- -s) shift; check_status; exit;;
- -k) shift; KILL=true;;
- -d) shift; SHUTDOWN=true;;
- --) shift; break;;
- *) display_error "Unknown option: $1" >&2;;
- esac
- done
- if test "$KILL" = "true" -o "$SHUTDOWN" = "true"; then
- stop_couchdb $KILL
- else
- start_couchdb
- fi
-}
-
-parse_script_option_list $@