couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [1/2] couchdb commit: updated refs/heads/set-hostname-during-configure to 23a0c2b
Date Wed, 09 Sep 2015 16:39:08 GMT
Repository: couchdb
Updated Branches:
  refs/heads/set-hostname-during-configure 3153c6ce0 -> 23a0c2bab


add mandatory --cookie option to ./configure, simplify hostname setting


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/f7f9472a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/f7f9472a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/f7f9472a

Branch: refs/heads/set-hostname-during-configure
Commit: f7f9472a6f965f8fd9d57bed6d7d0bad1bb0870e
Parents: 3153c6c
Author: Jan Lehnardt <jan@apache.org>
Authored: Wed Sep 9 18:36:39 2015 +0200
Committer: Jan Lehnardt <jan@apache.org>
Committed: Wed Sep 9 18:36:39 2015 +0200

----------------------------------------------------------------------
 configure               | 27 ++++++++++++++++++++++++++-
 rel/overlay/etc/vm.args |  4 ++--
 2 files changed, 28 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f7f9472a/configure
----------------------------------------------------------------------
diff --git a/configure b/configure
index e7edd90..2db6634 100755
--- a/configure
+++ b/configure
@@ -46,6 +46,7 @@ DATABASEDIR=
 VIEWDIR=
 LOGDIR=
 COUCHDB_USER=`whoami`
+COOKIE=
 
 display_help () {
     cat << EOF
@@ -66,6 +67,7 @@ Options:
   --disable-fauxton           do not build Fauxton
   --disable-docs              do not build any documentation or manpages
   --skip-deps                 do not update erlang dependencies
+  --cookie                    set the Erlang cookie value needed to talk to other nodes
 
 
   Installation directories:
@@ -470,6 +472,24 @@ parse_opts() {
                 exit 1
                 ;;
 
+                --cookie)
+                    if [ -n "$2" ]; then
+                        eval COOKIE=$2
+                        shift 2
+                        continue
+                    else
+                        printf 'ERROR: "--cookie" requires a non-empty argument.\n' >&2
+                        exit 1
+                    fi
+                    ;;
+                --cookie=?*)
+                    eval COOKIE=${1#*=}
+                    ;;
+                --cookie=)
+                    printf 'ERROR: "--cookie" requires a non-empty argument.\n' >&2
+                    exit 1
+                    ;;
+
             --) # End of options
                 shift
                 break
@@ -539,6 +559,10 @@ parse_opts() {
     if test -z "$PDFDIR"; then
         PDFDIR="$DOCDIR/pdf";
     fi
+    if test -z "$COOKIE"; then
+        echo "The --cookie is required. If you don’t want to set up a cluster, use $0 --cookie=monster"
+        exit 3
+    fi
 }
 
 parse_opts $@
@@ -581,7 +605,8 @@ cat > rel/couchdb.config << EOF
 {log_file, "$LOG_FILE"}.
 {fauxton_root, "$DATAROOTDIR/couchdb/www"}.
 {user, "$COUCHDB_USER"}.
-{node_name, "-name $FQDN"}.
+{node_name, "$FQDN"}.
+{cookie, "$COOKIE"}.
 {cluster_port, 5984}.
 {backend_port, 5986}.
 EOF

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f7f9472a/rel/overlay/etc/vm.args
----------------------------------------------------------------------
diff --git a/rel/overlay/etc/vm.args b/rel/overlay/etc/vm.args
index b69ad82..cd7abc2 100644
--- a/rel/overlay/etc/vm.args
+++ b/rel/overlay/etc/vm.args
@@ -14,12 +14,12 @@
 # (specified using -sname) or it can by fully qualified (-name).  There can be
 # no communication between nodes running with the -sname flag and those running 
 # with the -name flag.
-{{node_name}}
+-name {{node_name}}
 
 # All nodes must share the same magic cookie for distributed Erlang to work.
 # Comment out this line if you synchronized the cookies by other means (using
 # the ~/.erlang.cookie file, for example).
--setcookie monster
+-setcookie {{cookie}}
 
 # Tell kernel and SASL not to log anything
 -kernel error_logger silent


Mime
View raw message