Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

couchdb script no longer uses awk for configuration checks

git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@679821 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 314a2820d498082ee46cdcd2b64a7364c204764c 1 parent 7af5cf3
@nslater nslater authored
Showing with 39 additions and 60 deletions.
  1. +8 −0 CHANGES
  2. +5 −0 NEWS
  3. +26 −60 bin/couchdb.tpl.in
View
8 CHANGES
@@ -1,6 +1,14 @@
Apache CouchDB CHANGES
======================
+Version 0.8.1-incubating
+------------------------
+
+Packaging and System Integration:
+
+ * The `couchdb` script no longer uses `awk` for configuration checks as this
+ was causing portability problems.
+
Version 0.8.0-incubating
------------------------
View
5 NEWS
@@ -10,6 +10,11 @@ Version 0.9.0-incubating
This release is still under development.
+Version 0.8.1-incubating
+------------------------
+
+ * Minor fixes for the `couchdb` command.
+
Version 0.8.0-incubating
------------------------
View
86 bin/couchdb.tpl.in
@@ -96,17 +96,6 @@ display_error () {
exit $SCRIPT_ERROR
}
-_load_configuration () {
- dbrootdir_ini_value=`%AWK% -F = "/^DbRootDir=/{print \\$2}" < $INI_FILE`
- if test -n "$dbrootdir_ini_value"; then
- LIB_DIRECTORY=$dbrootdir_ini_value
- fi
- logfile_ini_value=`%AWK% -F = "/^LogFile=/{print \\$2}" < $INI_FILE`
- if test -n "$logfile_ini_value"; then
- LOG_DIRECTORY=`dirname $logfile_ini_value`
- fi
-}
-
_get_pid () {
if test -f $PID_FILE; then
PID=`cat $PID_FILE`
@@ -132,59 +121,37 @@ EOF
}
check_environment () {
+ if test "$BACKGROUND_BOOLEAN" != "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 $LIB_DIRECTORY; then
- echo "$message_prefix data directory: $LIB_DIRECTORY" >&2
+ if test ! -w $PID_FILE; then
+ echo "$message_prefix PID file: $PID_FILE" >&2
exit $SCRIPT_ERROR
fi
- if test ! -w $LOG_DIRECTORY; then
- echo "$message_prefix log directory: $LOG_DIRECTORY" >&2
+ if test ! -w $STDOUT_FILE; then
+ echo "$message_prefix STDOUT file: $STDOUT_FILE" >&2
exit $SCRIPT_ERROR
fi
- message_prefix="Apache CouchDB needs write permission on data file"
- for file in `find $LIB_DIRECTORY -type f`; do
- if test ! -w $file; then
- echo "$message_prefix: $file" >&2
- exit $SCRIPT_ERROR
- fi
- done
- message_prefix="Apache CouchDB needs write permission on log file"
- for file in `find $LOG_DIRECTORY -type f`; do
- if test ! -w $file; then
- echo "$message_prefix: $file" >&2
- exit $SCRIPT_ERROR
- fi
- done
- if test "$BACKGROUND_BOOLEAN" = "true"; then
- 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
- exit $SCRIPT_ERROR
- fi
- if test ! -w $STDOUT_FILE; then
- echo "$message_prefix STDOUT file: $STDOUT_FILE" >&2
- exit $SCRIPT_ERROR
- fi
- if test ! -w $STDERR_FILE; then
- echo "$message_prefix STDERR file: $STDERR_FILE" >&2
- exit $SCRIPT_ERROR
- fi
- message_prefix="Apache CouchDB needs a regular"
- if ! echo 2> /dev/null >> $PID_FILE; then
- echo "$message_prefix PID file: $PID_FILE" >&2
- exit $SCRIPT_ERROR
- fi
- if ! echo 2> /dev/null >> $STDOUT_FILE; then
- echo "$message_prefix STDOUT file: $STDOUT_FILE" >&2
- exit $SCRIPT_ERROR
- fi
- if ! echo 2> /dev/null >> $STDERR_FILE; then
- echo "$message_prefix STDERR file: $STDERR_FILE" >&2
- exit $SCRIPT_ERROR
- fi
+ if test ! -w $STDERR_FILE; then
+ echo "$message_prefix STDERR file: $STDERR_FILE" >&2
+ exit $SCRIPT_ERROR
+ fi
+ message_prefix="Apache CouchDB needs a regular"
+ if ! echo 2> /dev/null >> $PID_FILE; then
+ echo "$message_prefix PID file: $PID_FILE" >&2
+ exit $SCRIPT_ERROR
+ fi
+ if ! echo 2> /dev/null >> $STDOUT_FILE; then
+ echo "$message_prefix STDOUT file: $STDOUT_FILE" >&2
+ exit $SCRIPT_ERROR
+ fi
+ if ! echo 2> /dev/null >> $STDERR_FILE; then
+ echo "$message_prefix STDERR file: $STDERR_FILE" >&2
+ exit $SCRIPT_ERROR
fi
}
@@ -307,7 +274,6 @@ parse_script_option_list () {
*) display_error "Unknown option: $1" >&2;;
esac
done
- _load_configuration
if test "$KILL_BOOLEAN" = "true" -o "$SHUTDOWN_BOOLEAN" = "true"; then
stop_couchdb $KILL_BOOLEAN
else
Please sign in to comment.
Something went wrong with that request. Please try again.