summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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).