summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2013-03-11 21:46:30 -0500
committerPaul J. Davis <paul.joseph.davis@gmail.com>2013-03-20 06:02:57 -0500
commit8f0ef8e3744b9d5d7ac208fdfc3ddbd87dd76588 (patch)
treeb30b180883b30f4ea5ceda900cc79c6fec4c5923
parentd164628b20442f354065955bea4e8b846983ce8b (diff)
downloadcouchdb-nebraska-merge-candidate.tar.gz
[review] Add a remsh scriptnebraska-merge-candidate
-rw-r--r--bin/couchdb.tpl.in2
-rwxr-xr-xbin/remsh27
2 files changed, 28 insertions, 1 deletions
diff --git a/bin/couchdb.tpl.in b/bin/couchdb.tpl.in
index 81bb8b840..709a56e07 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 \
diff --git a/bin/remsh b/bin/remsh
new file mode 100755
index 000000000..2d06b3792
--- /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).