You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2013/06/29 17:18:29 UTC

[48/50] [abbrv] git commit: updated refs/heads/1843-feature-bigcouch to cba2e81

[review] Add a remsh script


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

Branch: refs/heads/1843-feature-bigcouch
Commit: 8f0ef8e3744b9d5d7ac208fdfc3ddbd87dd76588
Parents: d164628
Author: Paul J. Davis <pa...@gmail.com>
Authored: Mon Mar 11 21:46:30 2013 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Wed Mar 20 06:02:57 2013 -0500

----------------------------------------------------------------------
 bin/couchdb.tpl.in |  2 +-
 bin/remsh          | 27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8f0ef8e3/bin/couchdb.tpl.in
----------------------------------------------------------------------
diff --git a/bin/couchdb.tpl.in b/bin/couchdb.tpl.in
index 81bb8b8..709a56e 100644
--- a/bin/couchdb.tpl.in
+++ b/bin/couchdb.tpl.in
@@ -231,7 +231,7 @@ start_couchdb () {
         touch $PID_FILE
         interactive_option="+Bd -noinput"
     fi
-    command="%ERL% $interactive_option $ERL_START_OPTIONS \
+    command="%ERL% -sname couchdb $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 \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8f0ef8e3/bin/remsh
----------------------------------------------------------------------
diff --git a/bin/remsh b/bin/remsh
new file mode 100755
index 0000000..2d06b37
--- /dev/null
+++ b/bin/remsh
@@ -0,0 +1,27 @@
+#!/usr/bin/env escript
+%%! -hidden -noshell -noinput
+
+main(_) ->
+    net_kernel:start([me(), shortnames]),
+    case net_adm:ping(couchdb()) of
+        pong ->
+            Shell = user_drv:start(['tty_sl -c -e',{couchdb(),shell,start,[]}]),
+            Ref = erlang:monitor(process, Shell),
+            receive
+                {'DOWN', Ref, _, _, _} -> ok
+            end,
+            halt(0);
+        _ ->
+            io:format("Error connection to: ~s", [couchdb()]),
+            halt(1)
+    end.
+
+
+me() ->
+    Localhost = net_adm:localhost(),
+    list_to_atom("couchdb_remsh" ++ os:getpid() ++ "@" ++ Localhost).
+
+
+couchdb() ->
+    Localhost = net_adm:localhost(),
+    list_to_atom("couchdb@" ++ Localhost).